Method, apparatus, device and storage medium of data acquisition
AssigneeBeijing Bytedance Network Technology Co., Ltd.
InventorChaoyang Shang
Life of this patent
Estimating the term…
Abstract
A method of data acquisition includes activating a local server proxy in a preset application program; acquiring a preset connection function, and replacing a destination address in the preset connection function with a target address corresponding to a local server proxy, to establish a connection between the preset application program and the local server proxy; 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; acquiring data during a procedure of data forwarding between the real server and the preset application program via the local server proxy.
Claims16
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.
An electronic device, comprising:
- a memory;
- and
- a processor,
- wherein the memory is used to store one or more computer instructions which, when executed by the processor, cause the processor to perform a method 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.
A computer program product comprising a non-transitory computer readable storage medium storing one or more computer instructions thereon which are executed by a processor to:
- activate a local server proxy in a preset application program;
- in accordance with a determination that the preset application program invokes a preset connection function, acquire 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;
- establish 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
- acquire 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.
Dependencies are inferred from the claim text.