US 11,777,997 B2
Method, apparatus, device and storage medium of data acquisition
Chaoyang Shang, Beijing (CN)
Assigned to BEIJING BYTEDANCE NETWORK TECHNOLOGY CO., LTD., Beijing (CN)
Filed by BEIJING BYTEDANCE NETWORK TECHNOLOGY CO., LTD., Beijing (CN)
Filed on Apr. 11, 2022, as Appl. No. 17/717,832.
Claims priority of application No. 202111598171.5 (CN), filed on Dec. 24, 2021.
Prior Publication US 2023/0208886 A1, Jun. 29, 2023
Int. Cl. H04L 29/06 (2006.01); H04L 9/40 (2022.01); H04L 9/32 (2006.01); H04L 61/59 (2022.01)
CPC H04L 63/205 (2013.01) [H04L 9/321 (2013.01); H04L 61/59 (2022.05); H04L 63/0281 (2013.01); H04L 63/0823 (2013.01)] 16 Claims
OG exemplary drawing
 
1. A method of data acquisition, comprising:
activating a local server proxy in a preset application program;
in accordance with a determination that the preset application program invokes a preset connection function, acquiring the preset connection function, and replacing a destination address in the preset connection function with a target address corresponding to the local server proxy, to establish a connection between the preset application program and the local server proxy, wherein the preset connection function is a connection function called when the preset application program initiates a network request, the destination address is an address of a remote server with which the preset application program needs to establish a network connection, and the target address is pre-written in the preset application program;
establishing a connection between the local server proxy and a real server corresponding to the target address based on connection information received from the preset application program via the local server proxy; and
acquiring data during a procedure of data forwarding between the real server and the preset application program via the local server proxy,
wherein the method further comprises: before determining that the preset application program invokes the preset connection function,
loading a first core library into the preset application program, wherein the first core library performs centralized management of the invoking of a preset socket by injecting a proxy connection function in the first core library into a second core library, the second core library contains a preset connection function for establishing a connection to the preset socket and
injecting a self-defined connection function into the second core library based on a preset injection approach corresponding to the proxy connection function,
wherein replacing the destination address with the target address comprises:
in accordance with a determination that the preset application program invokes a preset connection function via the second core library, invoking the self-defined connection function instead to replace the destination address of the preset connection function with the target address corresponding to the local server proxy.