# US 2025/0168239 A1 · Service response method and apparatus, device, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0168239 A1
- Document ID: US20250168239A1
- Status: Published application
- Kind: A1
- Application number: 18/839,635
- Filed: 2023-05-10
- Published: 2025-05-22
- Earliest claimed: 2022-05-11
- Assignees: Beijing Bytedance Network Technology Co., Ltd.
- Applicants: Beijing Bytedance Network Technology Co., Ltd.
- Inventors: Yuyao YANG; Jinyan WANG; Jianping CHEN
- Web page: https://patentgrep.com/patent/US20250168239A1

## CPC

- H04L 67/146: Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
- H04L 67/141: Setup of application sessions (admission control or resource allocation in data switching networks H04L47/70)
- H04L 69/162: {involving adaptations of sockets based mechanisms (secure socket layer H04L63/168)}
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Embodiments of the present disclosure provide a service response method and apparatus, a device, and a storage medium. According to the method, a service request packet initiated by a request client through a preset service port is detected using a socket detection mechanism; target client identification information corresponding to the request client is determined based on the service request packet; then, based on the target client identification information, a target socket corresponding to the service request packet is determined from a pre-established service data file in which client identification information of connected clients and sockets of service response processes connected to the connected clients are correspondingly stored; and the service request packet is sent to a target service response process based on the target socket.

## Claims

### Claim at position 1

1-14. (canceled)

### Claim 15

A service response method, comprising:
in response to detecting, using a socket detection mechanism, a service request packet initiated by a request client through a preset service port, determining target client identification information corresponding to the request client based on the service request packet;
determining a target socket corresponding to the service request packet based on the target client identification information and a pre-established service data file, wherein client identification information of a connected client having connected to a service response process and a socket of the service response process connected to the connected client are stored in correspondence in the service data file; and
sending the service request packet to a target service response process through the target socket.

### Claim 16 (depends on 15)

The service response method according to claim 15, wherein the service request packet carries a protocol port of a request client, an Internet protocol address of the request client, a protocol port of a service response process, an Internet protocol address of the service response process, and a transport layer protocol; and
the determining target client identification information corresponding to the request client based on the service request packet comprises:
generating the target client identification information corresponding to the request client based on the protocol port of the request client, the Internet protocol address of the request client, the protocol port of the service response process, the Internet protocol address of the service response process, and the transport layer protocol.

### Claim 17 (depends on 16)

The service response method according to claim 16, wherein the generating the target client identification information corresponding to the request client based on the protocol port of the request client, the Internet protocol address of the request client, the protocol port of the service response process, the Internet protocol address of the service response process, and the transport layer protocol comprises:
performing calculation by using a preset hash algorithm based on the protocol port of the request client, the Internet protocol address of the request client, the protocol port of the service response process, the Internet protocol address of the service response process, and the transport layer protocol, and using a calculated hash value as the target client identification information corresponding to the request client.

### Claim 18 (depends on 15)

The service response method according to claim 15, wherein the determining a target socket corresponding to the service request packet based on the target client identification information and a pre-established service data file comprises:
in response to having not found the target client identification information or a socket of a service response process corresponding to the target client identification information based on the pre-established service data file, determining the target socket corresponding to the service request packet based on a preset socket option of at least one socket for detecting the preset service port.

### Claim 19 (depends on 18)

The service response method according to claim 18, wherein the preset socket option comprises a process flag, and the process flag is used to reflect a correspondence between a socket and a service response process; and
the determining the target socket corresponding to the service request packet based on a preset socket option of at least one socket for detecting the preset service port comprises:
determining the target socket corresponding to the service request packet based on a process flag of the at least one socket for detecting the preset service port.

### Claim 20 (depends on 19)

The service response method according to claim 19, wherein the service response process comprises an old service response process for connecting to a service resource before a service version update and a new service response process for connecting to a service resource after the service version update; and
the determining the target socket corresponding to the service request packet based on a process flag of the at least one socket for detecting the preset service port comprises:
determining, based on the process flag of the at least one socket for detecting the preset service port, a socket corresponding to the new service response process as a candidate socket; and
determining the target socket corresponding to the service request packet based on the candidate socket.

### Claim 21 (depends on 20)

The service response method according to claim 20, further comprising:
in response to receiving an update instruction for updating a service version of a service resource, creating a child process for connecting to an updated service resource with a service response process currently connected to the service resource as a parent process, and using the parent process as an old service response process, and the child process as a new service response process.

### Claim 22 (depends on 21)

The service response method according to claim 21, further comprising:
adding a preset socket option to at least one socket corresponding to the old service response process and used to detect the preset service port, so as to distinguish at least one of the following: a correspondence between the at least one socket and each of the old service response process and the new service response process; and a correspondence between the at least one socket and a packet type of the service request packet.

### Claim 23 (depends on 18)

The service response method according to claim 18, wherein the preset socket option further comprises a protocol flag, and the protocol flag is used to reflect a correspondence between a socket and a packet type of the service request packet; and
the determining the target socket corresponding to the service request packet based on a preset socket option of at least one socket for detecting the preset service port comprises:
determining a socket corresponding to the packet type corresponding to the service request packet as a candidate socket based on the protocol flag of the at least one socket for detecting the preset service port; and
determining the target socket corresponding to the service request packet based on the candidate socket.

### Claim 24 (depends on 18)

The service response method according to claim 18, wherein after the sending the service request packet to a target service response process through the target socket, the method further comprises:
storing the target client identification information corresponding to the request client and the target socket in correspondence in the service data file.

### Claim 25 (depends on 18)

The service response method according to claim 18, further comprising:
in response to finding a socket of a service response process corresponding to the target client identification information based on the pre-established service data file, using the found socket of the service response process corresponding to the target client identification information as the target socket corresponding to the service request packet.

### Claim 26

An electronic device, comprising:
at least one processor; and
a storage apparatus configured to store at least one program, wherein
the at least one program, when executed by the at least one processor, causes the at least one processor to:
in response to detecting, using a socket detection mechanism, a service request packet initiated by a request client through a preset service port, determine target client identification information corresponding to the request client based on the service request packet;
determine a target socket corresponding to the service request packet based on the target client identification information and a pre-established service data file, wherein client identification information of a connected client having connected to a service response process and a socket of the service response process connected to the connected client are stored in correspondence in the service data file; and
send the service request packet to a target service response process through the target socket.

### Claim 27 (depends on 26)

The electronic device according to claim 26, wherein the service request packet carries a protocol port of a request client, an Internet protocol address of the request client, a protocol port of a service response process, an Internet protocol address of the service response process, and a transport layer protocol; and
wherein the at least one processor is caused to determine target client identification information corresponding to the request client based on the service request packet by:
generating the target client identification information corresponding to the request client based on the protocol port of the request client, the Internet protocol address of the request client, the protocol port of the service response process, the Internet protocol address of the service response process, and the transport layer protocol.

### Claim 28 (depends on 27)

The electronic device according to claim 27, wherein the at least one processor is caused to generate the target client identification information by:
performing calculation by using a preset hash algorithm based on the protocol port of the request client, the Internet protocol address of the request client, the protocol port of the service response process, the Internet protocol address of the service response process, and the transport layer protocol, and using a calculated hash value as the target client identification information corresponding to the request client.

### Claim 29 (depends on 26)

The electronic device according to claim 26, wherein the at least one processor is caused to the determine a target socket corresponding to the service request packet based on the target client identification information and a pre-established service data file by:
in response to having not found the target client identification information or a socket of a service response process corresponding to the target client identification information based on the pre-established service data file, determining the target socket corresponding to the service request packet based on a preset socket option of at least one socket for detecting the preset service port.

### Claim 30 (depends on 29)

The electronic device according to claim 29, wherein the preset socket option comprises a process flag, and the process flag is used to reflect a correspondence between a socket and a service response process; and
wherein the at least one processor is caused to determine the target socket corresponding to the service request packet based on a preset socket option of at least one socket for detecting the preset service port by:
determining the target socket corresponding to the service request packet based on a process flag of the at least one socket for detecting the preset service port.

### Claim 31 (depends on 29)

The electronic device according to claim 29, wherein the preset socket option further comprises a protocol flag, and the protocol flag is used to reflect a correspondence between a socket and a packet type of the service request packet; and
wherein the at least one processor is caused to determine the target socket corresponding to the service request packet based on a preset socket option of at least one socket for detecting the preset service port comprises:
determining a socket corresponding to the packet type corresponding to the service request packet as a candidate socket based on the protocol flag of the at least one socket for detecting the preset service port; and
determining the target socket corresponding to the service request packet based on the candidate socket.

### Claim 32 (depends on 29)

The electronic device according to claim 29, wherein the at least one processor is further caused to:
store the target client identification information corresponding to the request client and the target socket in correspondence in the service data file.

### Claim 33 (depends on 29)

The electronic device according to claim 29, wherein the at least one processor is further caused to:
in response to finding a socket of a service response process corresponding to the target client identification information based on the pre-established service data file, use the found socket of the service response process corresponding to the target client identification information as the target socket corresponding to the service request packet.

### Claim 34

A storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to:
in response to detecting, using a socket detection mechanism, a service request packet initiated by a request client through a preset service port, determine target client identification information corresponding to the request client based on the service request packet;
determine a target socket corresponding to the service request packet based on the target client identification information and a pre-established service data file, wherein client identification information of a connected client having connected to a service response process and a socket of the service response process connected to the connected client are stored in correspondence in the service data file; and
send the service request packet to a target service response process through the target socket.
