IP Library Granted Patent US 12712832
Granted Patent B2
US 12712832 · App. 18/999,400 · Granted Aug 18, 2026

Method and apparatus, device, and medium for creating message channel

Inventor: Qinghao Zhu (Beijing, CN)
Assignee: Lemon Inc.
H04L51/04H04L65/1069H04L67/141
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12712832
App. No.
18/999,400
Granted
Aug 18, 2026
Kind
B2
Abstract

The present invention relates to the field of computer technologies, and discloses methods and apparatuses for creating a message channel, a device, and a medium. In the methods provided in embodiments of the present application, a client performs a message channel creation operation, and transmits a communication port for the message channel and a page identifier to a web end.

Claims (58)

1 . A method for creating a message channel, the method comprising:

receiving a first message notification sent by a web end, wherein the first message notification is used to notify a client to create a message channel;

performing a message channel creation operation in response to the first message notification, to obtain a channel port corresponding to the message channel, wherein the channel port comprises a first communication port of the client and a second communication port of the web end;

determining a target page identifier corresponding to a target page with which the client is currently requesting to communicate, wherein the target page identifier is a page identifier that the client authenticates before creating the message channel; and

generating a second message notification based on the target page identifier and the second communication port, and sending the second message notification to the web end, wherein the web end performs, on the target page, message transmission with the client by using the second communication port.

2 . The method according to claim 1 , wherein performing a message channel creation operation to obtain a channel port corresponding to the message channel comprises:

calling a main thread to create the message channel according to a preset method, to obtain a port array returned by the preset method;

parsing the port array to obtain the first communication port and the second communication port; and

constructing the channel port with the first communication port and the second communication port.

3 . The method according to claim 2 , wherein before calling a main thread to create the message channel according to a preset method, to obtain a port array returned by the preset method, the method further comprises:

obtaining a current page identifier list at the web end, wherein the page identifier list comprises at least one accessible page identifier;

obtaining permission information corresponding to the page identifier; and

triggering a message channel creation mechanism to take effect in response to the permission information being verified, wherein the message channel creation mechanism is used to call the main thread to create the message channel according to the preset method.

4 . The method according to claim 1 , wherein the method further comprises:

calling a target thread to monitor, through the first communication port, message content from the web end, wherein the target thread is any thread, other than a main thread, in the client;

processing the message content according to preset message processing logic, to obtain a processing result, wherein the preset message processing logic is configured at the client during the message channel creation process; and

sending the processing result to the target page at the web end through the first communication port.

5 . The method according to claim 4 , further comprises:

configuring the preset message processing logic based on the first communication port, wherein the preset message processing logic is used to process a message sent by the web end.

6 . The method according to claim 1 , wherein the client handles underlying operations and service logic and providing functions that are integrated with devices and systems.

7 . The method according to claim 5 , wherein the web end constructs interfaces and implements part of the service logic, and wherein the client communicates and interacts with the web end through JSBridge.

8 . The method according to claim 5 , wherein the port array comprises the first element channel representing a communication port held by the client, and the second element channel representing a communication port held by the web end.

9 . The method according to claim 8 , wherein the preset message processing logic is further used to call a native function or enable bidirectional communication.

10 . A method for creating a message channel, the method comprising:

obtaining a current communication connection requirement triggered based on a web end;

sending a first message notification to a client in response to the communication connection requirement, wherein the client is configured to perform a message channel creation operation to obtain a channel port, wherein the channel port comprises a first communication port of the client and a second communication port of the web end;

receiving a second message notification sent from the client, wherein the second message notification carries the second communication port and a target page identifier, wherein the target page identifier is a page identifier of a target page with which the client is currently requesting to communicate; and

sending message content to the client through the second communication port on the target page corresponding to the target page identifier.

11 . The method according to claim 10 , wherein the receiving a second message notification sent from the client comprises:

receiving the second message notification through a target main window, and extracting the target page identifier from the second message notification, wherein the target main window is a main window of the target page; and

confirming receipt of the second message notification in response to a page identifier of the target main window being consistent with the target page identifier.

12 . The method according to claim 10 , wherein the communication connection requirement of the web end at least includes:

the web end sends data input or operated by a user;

the web end transmits page status information;

the web end monitors and receives an event triggered by the client; or

the web end performs bidirectional communication with the client.

13 . A non-transitory computer-readable storage medium, having stored thereon computer instructions, wherein the computer instructions are used to cause a computer to:

receive a first message notification sent by a web end, wherein the first message notification is used to notify a client to create a message channel;

perform a message channel creation operation in response to the first message notification, to obtain a channel port corresponding to the message channel, wherein the channel port comprises a first communication port of the client and a second communication port of the web end;

determine a target page identifier corresponding to a target page with which the client is currently requesting to communicate, wherein the target page identifier is a page identifier that the client authenticates before creating the message channel; and

generate a second message notification based on the target page identifier and the second communication port, and sending the second message notification to the web end, wherein the web end performs, on the target page, message transmission with the client by using the second communication port.

14 . The medium according to claim 13 , wherein the computer instructions causing the computer to perform a message channel creation operation to obtain a channel port corresponding to the message channel comprise computer instructions causing the computer to:

call a main thread to create the message channel according to a preset method, to obtain a port array returned by the preset method;

parse the port array to obtain the first communication port and the second communication port; and

construct the channel port with the first communication port and the second communication port.

15 . The medium according to claim 14 , wherein before calling a main thread to create the message channel according to a preset method, to obtain a port array returned by the preset method, the computer instructions further comprise computer instructions causing the computer to:

obtain a current page identifier list at the web end, wherein the page identifier list comprises at least one accessible page identifier;

obtain permission information corresponding to the page identifier; and

trigger a message channel creation mechanism to take effect in response to the permission information being verified, wherein the message channel creation mechanism is used to call the main thread to create the message channel according to the preset method.

16 . The medium according to claim 13 , wherein the computer instructions further comprise computer instructions causing the computer to:

call a target thread to monitor, through the first communication port, message content from the web end, wherein the target thread is any thread, other than a main thread, in the client;

process the message content according to preset message processing logic, to obtain a processing result, wherein the preset message processing logic is configured at the client during the message channel creation process; and

send the processing result to the target page at the web end through the first communication port.

17 . The method according to claim 16 , the computer instructions further comprise computer instructions causing the computer to:

configure the preset message processing logic based on the first communication port, wherein the preset message processing logic is used to process a message sent by the web end.

18 . The medium according to claim 13 , wherein the client handles underlying operations and service logic and provides functions that are integrated with devices and systems.

19 . The medium according to claim 14 , wherein the web end constructs interfaces and implements part of the service logic, and wherein the client communicates and interacts with the web end through JSBridge.

20 . The medium according to claim 14 , wherein the port array comprises the first element channel representing a communication port held by the client, and the second element channel representing a communication port held by the web end.