CN115766840A - Service data transmission method and device based on single websocket link channel - Google Patents

Service data transmission method and device based on single websocket link channel Download PDF

Info

Publication number
CN115766840A
CN115766840A CN202211323567.3A CN202211323567A CN115766840A CN 115766840 A CN115766840 A CN 115766840A CN 202211323567 A CN202211323567 A CN 202211323567A CN 115766840 A CN115766840 A CN 115766840A
Authority
CN
China
Prior art keywords
client
service
service data
link channel
websocket link
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211323567.3A
Other languages
Chinese (zh)
Inventor
龙中胜
雷洪文
龙罡
叶青
温凌敏
付信榕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haoyun Technologies Co Ltd
Original Assignee
Haoyun Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Haoyun Technologies Co Ltd filed Critical Haoyun Technologies Co Ltd
Priority to CN202211323567.3A priority Critical patent/CN115766840A/en
Publication of CN115766840A publication Critical patent/CN115766840A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a business data transmission method and a device based on a single websocket link channel, wherein the method is suitable for a SaaS (software as a service) server, the SaaS server is connected with a plurality of clients, and the method comprises the following steps: establishing a websocket link channel with each client based on a physical connection mode; the method comprises the steps of obtaining subscription information transmitted by a client, and extracting a plurality of subscribed service interfaces from the subscription information, wherein each service interface corresponds to a service; and extracting corresponding service data according to each service interface, and transmitting a plurality of service data to the client by using the websocket link channel for distribution and display by the client. The invention can enable a plurality of service data to share one websocket link channel, so as to reduce the number of the websocket link channels and improve the utilization rate of the link channels.

Description

Service data transmission method and device based on single websocket link channel
Technical Field
The invention relates to the technical field of service data interactive transmission, in particular to a service data transmission method and device based on a single websocket link channel.
Background
A SaaS (Software-as-a-Service) platform is a platform that provides Software services through a network. After purchasing and installing the application software, the user can interact with the service end of the platform through the personal terminal of the user so as to call the application function of the platform.
As the business demands of different users increase, the application software of the platform will increase different business services. In order to transmit different service data to different users, a data interactive mode commonly used at present is as follows: and when the client of the user needs corresponding service data, the SaaS server side can transmit the service data to the client through the corresponding websocket link channel.
However, the conventional method has the following technical problems: with the increase of users of application software, the number of business services is gradually increased, the number of websocket link channels required to be established is also increased, and the resource and application cost of the system is increased. Different services are different in requirements, if part of services are only intermittently used by a small number of clients, the vacant time of the websocket link channel is long, and the data communication utilization rate is low.
Disclosure of Invention
The invention provides a business data transmission method and a device based on a single websocket link channel, wherein the method can determine a plurality of business services subscribed by a client after a websocket link channel is established between a SaaS server and each client, and simultaneously push data of the plurality of business services to the client through the single websocket link channel when a client user calls the business services, so that the number of the websocket link channels is reduced, and the utilization rate of the link channel is increased.
A first aspect of an embodiment of the present invention provides a service data transmission method based on a single websocket link channel, where the method is applicable to a SaaS server, where the SaaS server is connected to multiple clients, and the method includes:
establishing a websocket link channel with each client based on a physical connection mode;
the method comprises the steps of obtaining subscription information transmitted by a client, and extracting a plurality of subscribed service interfaces from the subscription information, wherein each service interface corresponds to a service;
and extracting corresponding service data according to each service interface, and transmitting a plurality of service data to the client by using the websocket link channel for distribution and display by the client.
In a possible implementation manner of the first aspect, the establishing a websocket link channel with each client based on a physical connection manner includes:
after the client logs in on a preset front-end page and the login is successful, receiving a connection request sent by the client through a websocket link communication address;
responding to the connection request and sending a connection heartbeat packet to the client;
and when a reply heartbeat packet fed back by the client is received, determining to establish a websocket link channel with the client.
In a possible implementation manner of the first aspect, the extracting, according to each service interface, corresponding service data and transmitting, by using the websocket link channel, a plurality of service data to a client includes:
extracting service data from the corresponding service object according to the interface format of each service interface to obtain a plurality of service data;
searching an ID (identity) of a client, and determining a corresponding websocket link channel according to the ID;
and calling the websocket link channel to transmit a plurality of service data to the client.
In a possible implementation manner of the first aspect, after the step of transmitting the service data to the client by using the websocket link channel, the method further includes:
and when the client logs out or the websocket link channel is interrupted, stopping pushing a plurality of service data to the client.
A second aspect of the embodiments of the present invention provides a service data transmission method based on a single websocket link channel, where the method is applied to a client, the client is connected to a SaaS server, and the method includes:
establishing a websocket link channel with a SaaS server based on a physical connection mode;
the method comprises the steps that subscription information is sent to a SaaS server, wherein the subscription information comprises a plurality of business services selected by a user, and each business service corresponds to a business interface;
and receiving a plurality of service data sent by the SaaS server through the websocket link channel, and distributing and displaying the service data by adopting the plurality of service data.
In a possible implementation manner of the second aspect, the establishing a websocket link channel with the SaaS server based on the physical connection manner includes:
after logging in a front-end page preset by the SaaS server and successful logging in, linking a connection request sent to the SaaS server through a websocket link communication address of the SaaS server;
and receiving a connection heartbeat packet sent by the SaaS server, and determining to establish a websocket link channel with the SaaS server when a reply heartbeat packet fed back to the SaaS server is received.
In a possible implementation manner of the second aspect, the performing, by using a plurality of service data, distribution and display includes:
acquiring a service identifier corresponding to each service data, and determining a service type corresponding to the service identifier;
searching a corresponding display page in a preset page routing table based on the service type, wherein the preset page routing table is composed of a plurality of service types, and each service type corresponds to a service page;
and adding each service data to a corresponding display page.
In a possible implementation manner of the second aspect, after the step of performing distribution display by using a plurality of service data, the method further includes:
and when logging out or the websocket link channel connection is interrupted, stopping receiving the service data sent by the SaaS server.
A third aspect of an embodiment of the present invention provides a service data transmission device based on a single websocket link channel, where the device is applicable to a SaaS server, the SaaS server is connected to multiple clients, and the device includes:
the server side establishing module is used for establishing a websocket link channel with each client side based on a physical connection mode;
the server side acquisition module is used for acquiring subscription information transmitted by a client side and extracting a plurality of subscribed service interfaces from the subscription information, wherein each service interface corresponds to one service;
and the server-side transmission module is used for extracting corresponding service data according to each service interface and transmitting a plurality of service data to the client side by using the websocket link channel so as to be distributed and displayed by the client side.
A fourth aspect of the embodiments of the present invention provides a service data transmission device based on a single websocket link channel, where the device is applicable to a client, the client is connected to a SaaS server, and the device includes:
the client establishing module is used for establishing a websocket link channel with the SaaS server based on a physical connection mode;
the client sending module is used for sending subscription information to the SaaS server, wherein the subscription information comprises a plurality of business services selected by a user, and each business service corresponds to a business interface;
and the client transmission module is used for receiving a plurality of service data sent by the SaaS server through the websocket link channel and distributing and displaying the service data by adopting a plurality of service data.
Compared with the prior art, the service data transmission method and device based on the single websocket link channel provided by the embodiment of the invention have the beneficial effects that: the invention can enable the SaaS server side and each client side to establish a websocket link channel, acquire subscription information of the client side, determine a plurality of business services required by a user based on the subscription information, and simultaneously push data of the plurality of business services to the client side through a single websocket link channel when the client side user calls the business services, so that a plurality of business data can share one websocket link channel, the number of the websocket link channels is reduced, and the utilization rate of the connection channel is increased.
Drawings
Fig. 1 is a schematic flow chart of a service data transmission method based on a single websocket link channel according to an embodiment of the present invention;
fig. 2 is an operation flowchart of a service data transmission method based on a single websocket link channel according to an embodiment of the present invention;
fig. 3 is an interaction flowchart of a service data transmission method based on a single websocket link channel according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a service data transmission method based on a single websocket link channel according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a service data transmission apparatus based on a single websocket link channel according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a service data transmission apparatus based on a single websocket link channel according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A SaaS (Software-as-a-Service) platform is a platform that provides Software services through a network. After purchasing and installing the application software, the user can interact with the service end of the platform through the personal terminal of the user so as to call the application function of the platform.
As the business demands of different users increase, the application software of the platform will increase different business services. In order to transmit different service data to different users, a data interactive mode commonly used at present is as follows: and when the client of the user needs corresponding service data, the SaaS server side can transmit the service data to the client through the corresponding websocket link channel.
However, the conventional method has the following technical problems: with the increase of users of application software, the number of business services is gradually increased, the number of websocket link channels required to be established is also increased, and the resource and application cost of the system is increased. And different services have different requirements, if part of services are only used by a small number of clients intermittently, the vacant time of the websocket link channel is long, and the data communication utilization rate is low.
In order to solve the above problem, a service data transmission method based on a single websocket link channel according to an embodiment of the present application will be described and explained in detail with the following specific embodiments.
Referring to fig. 1, a flowchart of a service data transmission method based on a single websocket link channel according to an embodiment of the present invention is shown.
In this embodiment, the method is applicable to a SaaS server, and the SaaS server may be connected to a plurality of clients. Each client can call one or more service services of the SaaS server, and specifically, the selection and adjustment can be performed according to the requirements of users.
As an example, the service data transmission method based on a single websocket link channel may include:
s11, establishing a websocket link channel with each client based on a physical connection mode.
In one embodiment, a websocket link channel can be established between the SaaS server and each client, when data transmission is needed, service data needed by each client can be transmitted through the websocket link channel, multiple websocket link channels do not need to be established, and the number of the websocket link channels is reduced; and a plurality of service data required by each client can share the link channel, so that system resources are saved.
Wherein, as an example, step S11 may comprise the following sub-steps:
and S111, after the client logs in on a preset front-end page and the login is successful, receiving a connection request sent by the client through the websocket link communication address.
And S112, responding to the connection request and sending a connection heartbeat packet to the client.
S113, when a reply heartbeat packet fed back by the client is received, determining that a websocket link channel is established with the client.
Specifically, the SaaS server can provide the websocket link communication service, such as providing the websocket service to the outside through the following addresses ws:// 192.168.14.170.
And then, the user of the client can log in on a front-end page preset by the SaaS server, and the user can enter a system home page after the user successfully logs in.
And then the client side can initiate a request to the SaaS server side through the address of the websocket link communication service, the whole process can establish a network link as an HTTP request, the SaaS server side sends heartbeat packet data to the client side in advance, the client side feeds back the heartbeat packet data to the SaaS server side after receiving the heartbeat packet data, and then the client side and the SaaS server side establish a websocket link channel.
It should be noted that, because of the websocket protocol, the connection is always maintained, and the connection is not automatically disconnected after the communication is finished, like HTTP.
The format of the initiation request of the client front end is as follows:
URl:ws://ip:port/hy/saas/websocket/{lessCode}/{appCode}/{token};
and the tenant, the application and the token are correct, the connection is successful, and otherwise, the connection fails.
S12, obtaining subscription information transmitted by a client, and extracting a plurality of subscribed service interfaces from the subscription information, wherein each service interface corresponds to a service.
After the link channel is established, the client may send subscription information to the SaaS server, where the subscription information may include one or more service services subscribed by the user, each service may correspond to one service interface, and each service interface may transmit interaction data of one service.
S13, extracting corresponding service data according to each service interface, and transmitting a plurality of service data to the client by using the websocket link channel for the client to distribute and display.
In an embodiment, after the client is determined to log in, corresponding service data can be directly and respectively searched according to service interfaces, and then a plurality of service data are simultaneously transmitted to the client by using a websocket link channel corresponding to the client, so that the client can adopt the plurality of service data for distribution and display.
In an optional embodiment, if the client has previously established at least one communication connection with the SaaS server, the SaaS server may search the previous subscription information of the client after receiving the subscription information of the client. Then determining whether the current subscription information is the same as the prior subscription information of the client, if so, directly extracting corresponding service data according to a service interface contained in the prior subscription information, and sending the service data to the client; if the subscription information is different, the corresponding service data can be extracted according to the service interface contained in the current subscription information, and the service data is sent to the client.
For example, when the SaaS server is a software application related to news, the subscription information of the client includes: after a subsequent user logs in, service data about the sports channel, the music channel and the science channel can be transmitted to the client side through the websocket link channel, and other types of service data cannot be pushed to the client side.
In one embodiment, step S13 may include the following sub-steps:
s131, extracting service data from the corresponding service object according to the interface format of each service interface to obtain a plurality of service data.
In an embodiment, the business object may specifically be an object providing a business service, and may be a business processing unit built in the SaaS server, or a business processing unit of a third party.
Because each business service corresponds to one interface and the formats of the interfaces are different, the business object to be called can be determined according to the interface format of the business interface, and then the corresponding business data can be extracted from the business object.
S132, searching the ID identification of the client, and determining the corresponding websocket link channel according to the ID identification.
In an implementation manner, after the client registers, the SaaS server stores a user account, a password, and a user ID of the client user in a preset user table.
After logging in, the ID identification of the client can be bound with the established websocket link channel, then the ID identification of the client is searched when data is transmitted, and the corresponding websocket link channel is determined based on the ID identification.
And S133, calling the websocket link channel to transmit a plurality of service data to the client.
And finally, calling the websocket link channel to transmit a plurality of service data subscribed by the client user to the client.
Because the client side obtains the plurality of service data, the client side can perform paging display on the plurality of service data so as to improve the viewing experience of the user, and the user can conveniently view the service data.
Referring to fig. 2, an operation flowchart of a service data transmission method based on a single websocket link channel according to an embodiment of the present invention is shown.
In one example, for ease of understanding, the service subscribed to by the user is a service provided by a third party unit.
Specifically, the client and the SaaS server may establish a connection first, and the client may send subscription information (the subscription information may include a plurality of service interface APIs) to the SaaS server at the same time. Then, the SaaS server can determine that the service to be subscribed is a common third-party open-source message middleware Kafka according to an interface format of one service interface API, extract corresponding service data from the third-party open-source message middleware Kafka, transmit the service data of the middleware Kafka to the client through the websocket link channel, determine a display page corresponding to the service data by the client, and add the display page to the corresponding display page for the user to view.
In the application process, communication between the client and the SaaS server may be interrupted, and information transmission needs to be stopped.
As an example, after the client displays the service data, the method may further include:
and S14, stopping pushing a plurality of service data to the client when the client logs out or the websocket link channel connection is interrupted.
Specifically, after the client logs out of the login, or after the websocket link channel connection is interrupted, it may be determined that the communication between the client and the SaaS server is interrupted, and at this time, the SaaS server may stop pushing the subscribed service data to the client.
In an optional embodiment, the SaaS server may actively send ping (plain text string) heartbeat information to the client at regular time, the client needs to reply a pong (plain text string) continuation, and if the continuation heartbeat is not received for a long time, the SaaS server may remove the client, so that the websocket link channel is disconnected.
Referring to fig. 3, an interaction flowchart of a service data transmission method based on a single websocket link channel according to an embodiment of the present invention is shown.
Specifically, the interaction between the client and the SaaS server comprises the following steps:
firstly, a client and a SaaS server establish a websocket link channel;
secondly, the client determines the registered pages, determines the service data required by each page, forms subscription information and sends the subscription information to the SaaS server;
thirdly, the client sends the subscription information to the SaaS server;
fourthly, the SaaS server calls a corresponding service interface API to extract corresponding service data according to the subscription information;
fifthly, searching a websocket link channel corresponding to the client by the SaaS server, and then calling the SaaS server to send the plurality of service data to the client;
and sixthly, the client determines a page corresponding to each service data according to the page routing table, and then adds each service data to a corresponding display page to realize paging display.
In this embodiment, an embodiment of the present invention provides a service data transmission method based on a single websocket link channel, which has the following beneficial effects: the invention can enable the SaaS server side and each client side to establish a websocket link channel, acquire subscription information of the client side, determine a plurality of business services required by a user based on the subscription information, and simultaneously push data of the plurality of business services to the client side through a single websocket link channel when the client side user calls the business services, so that a plurality of business data can share one websocket link channel, the number of the websocket link channels is reduced, and the utilization rate of the connection channel is increased.
Referring to fig. 4, a schematic flow chart of a service data transmission method based on a single websocket link channel according to an embodiment of the present invention is shown.
In this embodiment, the method is applicable to a client, and the client is connected with a SaaS server.
As an example, the service data transmission method based on a single websocket link channel may include:
and S21, establishing a websocket link channel with the SaaS server based on a physical connection mode.
Wherein, as an example, step S21 may comprise the following sub-steps:
and S211, after login is performed on a front-end page preset by the SaaS server and login is successful, a connection request sent to the SaaS server is linked through a websocket of the SaaS server.
S212, receiving a connection heartbeat packet sent by the SaaS server, and determining to establish a websocket link channel with the SaaS server when a reply heartbeat packet is fed back to the SaaS server.
In this embodiment, the above steps correspond to steps S11 and S111-113 of the above embodiments, and reference may be made to the above description for details, which are not repeated herein for avoiding redundancy.
S22, subscription information is sent to the SaaS server, the subscription information comprises a plurality of business services selected by the user, and each business service corresponds to one business interface.
In this embodiment, the above steps correspond to step S12 of the above embodiment, and reference may be specifically made to the above description, and details are not repeated herein to avoid repetition.
And S23, receiving a plurality of service data sent by the SaaS server through the websocket link channel, and distributing and displaying the service data by adopting the plurality of service data.
In this embodiment, the above steps correspond to step S13 of the above embodiment, and reference may be specifically made to the above description, so that details are not repeated herein to avoid redundancy.
In order to be able to present different service data on different pages, in an alternative embodiment, step S23 may include the following sub-steps:
s231, acquiring a service identifier corresponding to each service data, and determining a service type corresponding to the service identifier.
Specifically, the service identifier may be a label of an interface or an identity value of a service, the identity is a string type, and may be named arbitrarily, where like an identity card number, and 1 number identifies 1 service. The service type may be a type of a page showing service data.
S232, searching a corresponding display page in a preset page routing table based on the service types, wherein the preset page routing table is composed of a plurality of service types, and each service type corresponds to a service page.
And S233, adding each service data to the corresponding display page.
In specific implementation, the client may form a page routing table with types corresponding to different display pages in advance, after obtaining the service type, the client may search for the corresponding display page in the page routing table according to the service type, add different service data to the corresponding display page, make the different display pages all have their corresponding service data, and then display them separately.
In an embodiment, the method may further comprise the sub-steps of:
and S24, stopping receiving the service data sent by the SaaS server when logging out or the websocket link channel connection is interrupted.
In this embodiment, the above steps correspond to step S14 of the above embodiment, and reference may be specifically made to the above description, so that details are not repeated herein to avoid redundancy.
An embodiment of the present invention further provides a service data transmission device based on a single websocket link channel, and referring to fig. 5, a schematic structural diagram of the service data transmission device based on the single websocket link channel provided in the embodiment of the present invention is shown.
The device is suitable for the SaaS server, and the SaaS server is connected with a plurality of clients.
As an example, the service data transmission apparatus based on a single websocket link channel may include:
the server side creating module 501 is configured to establish a websocket link channel with each client side based on a physical connection manner;
a server obtaining module 502, configured to obtain subscription information transmitted by a client, and extract a plurality of subscribed service interfaces from the subscription information, where each service interface corresponds to a service;
the server side transmission module 503 is configured to extract corresponding service data according to each service interface, and transmit a plurality of service data to the client side by using the websocket link channel, so that the client side performs distribution and display.
Optionally, the server creation module is further configured to:
after the client logs in on a preset front-end page and the login is successful, receiving a connection request sent by the client through a websocket link communication address;
responding to the connection request and sending a connection heartbeat packet to the client;
and when a reply heartbeat packet fed back by the client is received, determining to establish a websocket link channel with the client.
Optionally, the server side transmission module is further configured to:
extracting service data from the corresponding service object according to the interface format of each service interface to obtain a plurality of service data;
searching an ID (identity) of a client, and determining a corresponding websocket link channel according to the ID;
and calling the websocket link channel to transmit a plurality of service data to a client.
Optionally, the apparatus further comprises:
and the server side stops pushing the service data when determining that the client side logs out or the websocket link channel is interrupted in connection, and stops pushing the service data to the client side.
An embodiment of the present invention further provides a service data transmission device based on a single websocket link channel, and referring to fig. 6, a schematic structural diagram of the service data transmission device based on the single websocket link channel provided in the embodiment of the present invention is shown.
The device is suitable for the client side, and the client side is connected with the SaaS server side.
As an example, the service data transmission apparatus based on a single websocket link channel may include:
the client establishing module 601 is used for establishing a websocket link channel with the SaaS server based on a physical connection mode;
a client sending module 602, configured to send subscription information to a SaaS server, where the subscription information includes a plurality of service services selected by a user, and each service corresponds to a service interface;
and the client transmission module 603 is configured to receive a plurality of service data sent by the SaaS server through the websocket link channel, and distribute and display the service data by using the plurality of service data.
Optionally, the client creating module is further configured to:
after login is performed on a front-end page preset by the SaaS server and the login is successful, a connection request sent to the SaaS server is linked through a websocket of the SaaS server by a communication address;
and receiving a connection heartbeat packet sent by the SaaS server, and determining to establish a websocket link channel with the SaaS server when a reply heartbeat packet fed back to the SaaS server is received.
Optionally, the client transmission module is further configured to:
acquiring a service identifier corresponding to each service data, and determining a service type corresponding to the service identifier;
searching a corresponding display page in a preset page routing table based on the service type, wherein the preset page routing table is composed of a plurality of service types, and each service type corresponds to a service page;
and adding each service data to a corresponding display page.
Optionally, after the step of distributing and displaying the service data by using a plurality of pieces of service data, the apparatus further includes:
and the client side stop receiving module is used for stopping receiving the service data sent by the SaaS server side when logging out or the websocket link channel connection is interrupted.
It can be clearly understood by those skilled in the art that, for convenience and brevity, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Further, an embodiment of the present application further provides an electronic device, including: the system comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein when the processor executes the program, the service data transmission method based on the single websocket link channel is realized.
Further, an embodiment of the present application further provides a computer-readable storage medium, where a computer-executable program is stored, and the computer-executable program is configured to enable a computer to execute the service data transmission method based on a single websocket link channel according to the foregoing embodiment.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A business data transmission method based on a single websocket link channel is characterized in that the method is suitable for a SaaS server, the SaaS server is connected with a plurality of clients, and the method comprises the following steps:
establishing a websocket link channel with each client based on a physical connection mode;
the method comprises the steps of obtaining subscription information transmitted by a client, and extracting a plurality of subscribed service interfaces from the subscription information, wherein each service interface corresponds to a service;
and extracting corresponding service data according to each service interface, and transmitting a plurality of service data to the client by using the websocket link channel for the client to distribute and display.
2. The method for transmitting the service data based on the single websocket link channel according to claim 1, wherein the establishing of one websocket link channel with each client based on a physical connection mode includes:
after the client logs in on a preset front-end page and the login is successful, receiving a connection request sent by the client through a websocket link communication address;
responding to the connection request and sending a connection heartbeat packet to the client;
and when a reply heartbeat packet fed back by the client is received, determining to establish a websocket link channel with the client.
3. The method for transmitting the service data based on the single websocket link channel of claim 1, wherein the extracting the corresponding service data according to each service interface and transmitting a plurality of service data to the client by using the websocket link channel comprises:
extracting service data from the corresponding service object according to the interface format of each service interface to obtain a plurality of service data;
searching an ID (identity) of a client, and determining a corresponding websocket link channel according to the ID;
and calling the websocket link channel to transmit a plurality of service data to the client.
4. The method for transmitting service data based on a single websocket link channel according to any one of claims 1 to 3, wherein after the step of transmitting a plurality of service data to the client by using the websocket link channel, the method further comprises:
and stopping pushing a plurality of service data to the client when the client logs out or the websocket link channel connection is interrupted.
5. A service data transmission method based on a single websocket link channel is characterized in that the method is suitable for a client side, the client side is connected with a SaaS server side, and the method comprises the following steps:
establishing a websocket link channel with a SaaS server based on a physical connection mode;
the method comprises the steps that subscription information is sent to a SaaS server, wherein the subscription information comprises a plurality of business services selected by a user, and each business service corresponds to a business interface;
and receiving a plurality of service data sent by the SaaS server through the websocket link channel, and distributing and displaying the service data by adopting the plurality of service data.
6. The service data transmission method based on the single websocket link channel of claim 5, wherein the establishing of the websocket link channel with the SaaS server based on the physical connection mode includes:
after logging in a front-end page preset by the SaaS server and successful logging in, linking a connection request sent to the SaaS server through a websocket link communication address of the SaaS server;
and receiving a connection heartbeat packet sent by the SaaS server, and determining to establish a websocket link channel with the SaaS server when a reply heartbeat packet fed back to the SaaS server is received.
7. The service data transmission method based on the single websocket link channel as claimed in claim 5, wherein the distributing and displaying by using a plurality of service data comprises:
acquiring a service identifier corresponding to each service data, and determining a service type corresponding to the service identifier;
searching a corresponding display page in a preset page routing table based on the service type, wherein the preset page routing table is composed of a plurality of service types, and each service type corresponds to a service page;
and adding each service data to a corresponding display page.
8. The method for transmitting service data based on the single websocket link channel according to any one of claims 5 to 7, wherein after the step of distributing and displaying the service data, the method further comprises:
and when logging out or the websocket link channel connection is interrupted, stopping receiving the service data sent by the SaaS server.
9. The utility model provides a business data transmission device based on single websocket links passageway which characterized in that, the device is applicable to the SaaS service end, the SaaS service end is connected with a plurality of customer ends, the device includes:
the server side establishing module is used for establishing a websocket link channel with each client side based on a physical connection mode;
the server side acquisition module is used for acquiring subscription information transmitted by a client side and extracting a plurality of subscribed service interfaces from the subscription information, wherein each service interface corresponds to one service;
and the server side transmission module is used for extracting corresponding service data according to each service interface and transmitting a plurality of service data to the client side by using the websocket link channel so as to be distributed and displayed by the client side.
10. The utility model provides a business data transmission device based on single websocket links passageway which characterized in that, the device is applicable to the customer end, the customer end is connected with the SaaS server side, the device includes:
the client establishing module is used for establishing a websocket link channel with the SaaS server based on a physical connection mode;
the client sending module is used for sending subscription information to the SaaS server, wherein the subscription information comprises a plurality of business services selected by users, and each business service corresponds to a business interface;
and the client transmission module is used for receiving a plurality of service data sent by the SaaS server through the websocket link channel and distributing and displaying the service data by adopting a plurality of service data.
CN202211323567.3A 2022-10-27 2022-10-27 Service data transmission method and device based on single websocket link channel Pending CN115766840A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211323567.3A CN115766840A (en) 2022-10-27 2022-10-27 Service data transmission method and device based on single websocket link channel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211323567.3A CN115766840A (en) 2022-10-27 2022-10-27 Service data transmission method and device based on single websocket link channel

Publications (1)

Publication Number Publication Date
CN115766840A true CN115766840A (en) 2023-03-07

Family

ID=85353520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211323567.3A Pending CN115766840A (en) 2022-10-27 2022-10-27 Service data transmission method and device based on single websocket link channel

Country Status (1)

Country Link
CN (1) CN115766840A (en)

Similar Documents

Publication Publication Date Title
CN111368173A (en) File transmission method and device, electronic equipment and readable storage medium
CN102158541B (en) Shared information acquisition method, device, mobile terminal and server
CN112291238B (en) Data communication method, device, equipment and computer readable storage medium
CN106533932A (en) Method and device for pushing instant message
WO2008074244A1 (en) An instant messaging method, system and apparatus
CN103167327A (en) Method, device and system of information interaction
CN108683653A (en) A kind of active message push system based on WebSocket
CN111541555A (en) Group chat optimization method and related product
CN113645127B (en) Message routing method, message routing device, electronic equipment and computer-readable storage medium
CN113055348B (en) Cross-platform data request method and device and electronic equipment
CN110475215B (en) Message editing, transmitting and displaying method, server and terminal thereof
WO2023155685A1 (en) Communication method, system, and apparatus, storage medium, and processor
CN115766840A (en) Service data transmission method and device based on single websocket link channel
US20230087220A1 (en) Data processing method and apparatus based on instant messaging, device, and storage medium
CN116308671A (en) Online bidding method based on MQTT protocol, electronic equipment and storage medium
CN104283762A (en) Method, system, client-side and server for transmitting instant messaging conversation content
CN113132745B (en) Live broadcast service system, method and server
CN110636114B (en) Customer service access method, access system, service system and cloud platform
CN114139093A (en) Data communication method, equipment and medium
CN114189502A (en) Information sending method, device, storage medium and equipment
CN108924182B (en) Text information sending method and device in virtual reality scene
CN106100979B (en) Instant messaging method and device
CN114285658B (en) System mutual jump login-free method based on WeChat authorization login
CN114157624B (en) Link connection method, device and equipment for instant messaging and storage medium
CN114125017B (en) Media information display method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination