Data updating method, device, server, storage medium and program product

文档序号:1952646 发布日期:2021-12-10 浏览:24次 中文

阅读说明:本技术 数据更新方法、装置、服务端、存储介质及程序产品 (Data updating method, device, server, storage medium and program product ) 是由 曹建奇 于 2021-02-24 设计创作,主要内容包括:本公开实施例提供了数据更新方法、装置、服务端、存储介质及程序产品。该方法包括:获取订阅通知,其中,订阅通知包括目标频道和来自目标频道的推送数据;根据频道会话映射关系集,确定与目标频道对应的会话标识,其中,频道会话映射关系集包括多个频道会话映射关系,每个频道会话映射关系用于表征频道与会话标识之间的映射关系,会话标识与应用客户端关联;向与会话标识对应的应用客户端发送推送数据,以使应用客户端根据推送数据进行数据更新。(The embodiment of the disclosure provides a data updating method, a data updating device, a server, a storage medium and a program product. The method comprises the following steps: acquiring a subscription notification, wherein the subscription notification comprises a target channel and push data from the target channel; determining a session identifier corresponding to a target channel according to a channel session mapping relationship set, wherein the channel session mapping relationship set comprises a plurality of channel session mapping relationships, each channel session mapping relationship is used for representing a mapping relationship between a channel and the session identifier, and the session identifier is associated with an application client; and sending push data to the application client corresponding to the session identifier so that the application client updates the data according to the push data.)

1. A data updating method is applied to an application system server side and comprises the following steps:

obtaining a subscription notification, wherein the subscription notification comprises a target channel and push data from the target channel;

determining a session identifier corresponding to the target channel according to a channel session mapping relationship set, wherein the channel session mapping relationship set comprises a plurality of channel session mapping relationships, each channel session mapping relationship is used for representing a mapping relationship between a channel requesting connection and the session identifier, and the session identifier is associated with an application client; and

and sending the push data to an application client corresponding to the session identifier so that the application client updates data according to the push data.

2. The method of claim 1, further comprising:

receiving communication connection requests based on a full-duplex communication protocol sent by at least one application client, wherein each communication connection request comprises a session identifier and request parameters, the request parameters comprise a channel requesting connection and/or service parameters, and the service parameters are used for determining push data of the channel requesting connection; and

and responding to each communication connection request, and establishing a communication connection with the application client.

3. The method of claim 2, wherein the request parameter comprises the traffic parameter;

the method further comprises the following steps:

determining the channel of the connection request according to the service parameters;

establishing a communication connection with the channel requesting the connection;

establishing a mapping relation between the channel requesting connection and the session identifier to obtain a channel session mapping relation; and

and obtaining the channel session mapping relation set according to the channel session mapping relations.

4. The method of claim 2, wherein the request parameters include a channel of the connection request and the service parameters, or a channel of the connection request;

the method further comprises the following steps:

establishing a communication connection with the channel requesting the connection;

establishing a mapping relation between the channel requesting connection and the session identifier to obtain a channel session mapping relation; and

and obtaining the channel session mapping relation set according to the channel session mapping relations.

5. The method of claim 1, wherein the push data from the target channel is obtained by processing raw data using a streaming method; or

The push data from the target channel is obtained by processing the original data by the data processing server side by using the streaming calculation method.

6. The method of claim 1, wherein the sending the push data to the application client corresponding to the session identifier to enable the application client to perform data update according to the push data comprises:

and sending the push data to an application client corresponding to the session identifier so that the application client updates and displays data according to the push data.

7. The method of claim 1, wherein the determining a session identifier corresponding to the target channel according to the channel session mapping relationship set comprises:

determining channels matched with the target channels from the channel session mapping relation set to obtain matched channels; and

and determining the session identifier corresponding to the matching channel as the session identifier corresponding to the target channel.

8. The method of any of claims 2-7, wherein the full-duplex communication protocol comprises Websocket.

9. The method according to any one of claims 1 to 7, wherein the application system server comprises an in-memory database, and the push data is stored in the in-memory database.

10. A data updating device is arranged at an application system server side and comprises:

the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a subscription notification, and the subscription notification comprises a target channel and push data from the target channel;

a first determining module, configured to determine a session identifier corresponding to the target channel according to a channel session mapping relationship set, where the channel session mapping relationship set includes a plurality of channel session mapping relationships, each channel session mapping relationship is used to represent a mapping relationship between a channel and a session identifier, and the session identifier is associated with an application client; and

and the sending module is used for sending the pushed data to the application client corresponding to the session identifier so that the application client updates data according to the pushed data.

11. An application system server, comprising:

one or more processors;

a memory for storing one or more programs,

wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-9.

12. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 9.

13. A computer program product comprising a computer program which, when executed by a processor, is adapted to carry out the method of any one of claims 1 to 9.

Technical Field

The disclosed embodiments relate to the field of computer technologies, and in particular, to a data updating method, an apparatus, an application system server, a storage medium, and a program product.

Background

Aiming at the problem of updating data in real time, in the related technology, the data is pulled regularly. The method comprises the steps that when the pull time is up, an application client sends a data acquisition request to a server, the server responds to the data acquisition request to acquire updated data and sends the updated data to the application client, and the application client updates the data according to the updated data.

In the course of implementing the disclosed concept, the inventors found that it is difficult to meet the scene requirements with high requirements on the effectiveness of data updating by using the related technology.

Disclosure of Invention

In view of this, the embodiments of the present disclosure provide a data updating method, an apparatus, an application server, a storage medium, and a program product.

One aspect of the embodiments of the present disclosure provides a data updating method, which is applied to an application system server, and the method includes: obtaining a subscription notification, wherein the subscription notification comprises a target channel and push data from the target channel; determining a session identifier corresponding to the target channel according to a channel session mapping relationship set, wherein the channel session mapping relationship set comprises a plurality of channel session mapping relationships, each channel session mapping relationship is used for representing a mapping relationship between a channel requesting connection and the session identifier, and the session identifier is associated with an application client; and sending the push data to an application client corresponding to the session identifier so that the application client performs data updating according to the push data.

According to an embodiment of the present disclosure, further comprising: receiving communication connection requests based on a full-duplex communication protocol sent by at least one application client, wherein each communication connection request comprises a session identifier and request parameters, the request parameters comprise a channel requesting connection and/or service parameters, and the service parameters are used for determining push data of the channel requesting connection; and responding to each communication connection request, and establishing communication connection with the application client.

According to an embodiment of the present disclosure, the request parameter includes the service parameter; the method further comprises the following steps: determining the channel requesting connection according to the service parameters; establishing communication connection with the channel requesting connection; establishing a mapping relation between the channel requesting connection and the session identifier to obtain a channel session mapping relation; and obtaining the channel session mapping relation set according to a plurality of channel session mapping relations.

According to an embodiment of the present disclosure, the request parameter includes the channel requesting connection and the service parameter, or the channel requesting connection; the method further comprises the following steps: establishing communication connection with the channel requesting connection; establishing a mapping relation between the channel requesting connection and the session identifier to obtain a channel session mapping relation; and obtaining the channel session mapping relation set according to a plurality of channel session mapping relations.

According to the embodiment of the disclosure, the push data from the target channel is obtained by processing the original data by using a stream computing method; or the push data from the target channel is obtained by processing the original data by the data processing server side by using the streaming calculation method.

According to an embodiment of the present disclosure, the sending the push data to the application client corresponding to the session identifier so that the application client performs data update according to the push data includes: and sending the push data to an application client corresponding to the session identifier so that the application client updates and displays data according to the push data.

According to an embodiment of the present disclosure, the determining a session identifier corresponding to the target channel according to the channel session mapping relationship set includes: determining channels matched with the target channels from the channel session mapping relation set to obtain matched channels; and determining the session identifier corresponding to the matching channel as the session identifier corresponding to the target channel.

According to an embodiment of the present disclosure, the full-duplex communication protocol includes Websocket.

According to an embodiment of the present disclosure, the application system server includes a memory database, and the push data is stored in the memory database.

Another aspect of the embodiments of the present disclosure provides a data update apparatus, disposed at an application system server, the apparatus including: the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a subscription notification, and the subscription notification comprises a target channel and push data from the target channel; a first determining module, configured to determine a session identifier corresponding to the target channel according to a channel session mapping relationship set, where the channel session mapping relationship set includes a plurality of channel session mapping relationships, each of the channel session mapping relationships is used to represent a mapping relationship between a channel and a session identifier, and the session identifier is associated with an application client; and the sending module is used for sending the push data to the application client corresponding to the session identifier so that the application client updates data according to the push data.

Another aspect of the embodiments of the present disclosure provides an application system server, including: one or more processors; a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described above.

Another aspect of the disclosed embodiments provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when the instructions are commonly known.

Another aspect of the embodiments of the present disclosure provides a computer program product comprising a computer program for implementing the method as described above when executed by a processor.

According to the embodiment of the disclosure, by obtaining a subscription notification, the subscription notification includes a target channel and push data from the target channel, a session identifier corresponding to the target channel is determined according to a channel session mapping relationship set, the channel session mapping relationship set includes a plurality of channel session mapping relationships, each channel session mapping relationship is used for representing a mapping relationship between a channel requesting connection and the session identifier, the session identifier is associated with an application client, and the push data is sent to the application client corresponding to the session identifier, so that the application client performs data update according to the push data. The application system server does not need to pull data and can actively send the push data to the application client, so that the time consumed by a pulling period is reduced, and meanwhile, the application client does not need to send a data acquisition request, so that the time consumed by network communication is reduced, the technical problem that the scene requirement with higher requirements on the data updating effectiveness is difficult to meet by adopting related technologies is at least partially overcome, and the effectiveness of the data updating is improved.

Drawings

The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:

FIG. 1 schematically illustrates an exemplary system architecture to which a data update method may be applied, according to an embodiment of the disclosure;

FIG. 2 schematically illustrates a flow chart of a data update method according to an embodiment of the present disclosure;

FIG. 3 schematically illustrates a block diagram of a data update system according to an embodiment of the present disclosure;

FIG. 4 schematically illustrates a signaling diagram of a data update method according to an embodiment of the disclosure;

FIG. 5 schematically illustrates a block diagram of a data update apparatus according to an embodiment of the present disclosure; and

fig. 6 schematically shows a block diagram of an application system server adapted to implement the data update method according to an embodiment of the present disclosure.

Detailed Description

Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.

The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.

All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.

Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).

In the process of implementing the present disclosure, the inventor finds that for a scene with a high requirement on the effectiveness of data update, for example, real-time data is displayed on a large screen, due to a manner of pulling data at a fixed time in the related art, transient data loss may be caused due to a pulling period and a network delay of requesting data, and although such an influence may be reduced by a manner of shortening the pulling period, the data is updated in real time in a visual effect, but the essence of the data is a non-real-time data updating manner, so that the effectiveness of data update using the related art is not high, and the scene requirement with a high requirement on the effectiveness of data update is difficult to meet.

In order to solve the above problems in the related art, the inventors found that the reason for the short data loss is the pull cycle interval and the network delay of the requested data, so if the time consumed by the pull cycle and the network communication can be reduced as much as possible, the effectiveness of data update can be improved, and the scene requirement with high requirement on the effectiveness of data update can be satisfied.

Based on this, the inventor proposes a scheme for implementing data update based on a data push manner, and a system for implementing the scheme includes an application system server and an application client, that is, the embodiments of the present disclosure provide a data update method and apparatus, and an application system server capable of applying the method. After an application client establishes a communication connection request for requesting to acquire data with an application system server, the application system server acquires a subscription notification, the subscription notification comprises a target channel and push data from the target channel, the application system server determines a session identifier corresponding to the target channel according to a channel session mapping relation set, the channel session mapping relation set comprises a plurality of channel session mapping relations, each channel session mapping relation is used for representing the mapping relation between the channel and the session identifier, the session identifier is associated with the application client, and the push data is sent to the application client corresponding to the session identifier, so that the application client performs data updating according to the push data.

According to the embodiment of the disclosure, after the application system server acquires the push data, the application system server actively sends the push data to the application client subscribed with the push function, so that the application client updates the data according to the push data. In the process, the application system server can actively send the push data to the application client without initiating a data acquisition request by the application client, and the application system server can send the update data to the application client under the condition of receiving the data acquisition request.

Fig. 1 schematically illustrates an exemplary system architecture 100 to which a data update method may be applied, according to an embodiment of the disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.

As shown in fig. 1, the system architecture 100 according to this embodiment may include application clients 101, 102, 103, a network 104 and an application system server 105. The network 104 serves to provide a medium for communication links between the application clients 101, 102, 103 and the application system server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.

A user may use the application clients 101, 102, 103 to interact with the application system server 105 over the network 104 to receive or send messages, etc. The application clients 101, 102, 103 may have installed thereon various messenger client applications such as, for example only, a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software.

The application clients 101, 102, 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to large display screens, smart phones, tablets, laptop portable computers, desktop computers, and the like.

The application server 105 may be an application server that provides various services, such as an application server that provides data update support for users using data displayed by the application clients 101, 102, 103 (for example only). The application system server can actively send the push data to the application client subscribed with the push function.

It should be noted that the data updating method provided by the embodiment of the present disclosure may be generally executed by the application system server 105. Accordingly, the data updating apparatus provided by the embodiment of the present disclosure may be generally disposed in the application system server 105. The data updating method provided by the embodiment of the present disclosure may also be executed by an application system server or an application system server cluster that is different from the application system server 105 and can communicate with the application clients 101, 102, and 103 and/or the application system server 105. Accordingly, the data updating apparatus provided in the embodiment of the present disclosure may also be disposed in an application system server or an application system server cluster that is different from the application system server 105 and can communicate with the application clients 101, 102, and 103 and/or the application system server 105.

It should be understood that the number of application clients, networks, and application system servers in FIG. 1 is merely illustrative. There may be any number of application clients, networks, and application system servers, as desired for implementation.

Fig. 2 schematically illustrates a flow chart of a data updating method according to an embodiment of the present disclosure.

As shown in FIG. 2, the method is applied to an application system server, and includes operations S210-S230.

In operation S210, a subscription notification is obtained, wherein the subscription notification includes a target channel and push data from the target channel.

According to the embodiment of the disclosure, the application system server may include a plurality of channels, and the target channel represents a channel subscribed by the application client or a channel requested to be connected by the application client, in other words, the target channel is a channel that needs to provide push data to the application client. Illustratively, the target channel is a channel that provides order information.

The application system server side obtains a subscription notification including the target channel and the push data from the target channel, and the subsequent application system server side sends the push data to the corresponding application client side. The presentation form of the subscription notification may include text, voice, or images.

In operation S220, a session identifier corresponding to the target channel is determined according to a channel session mapping relationship set, where the channel session mapping relationship set includes a plurality of channel session mapping relationships, each channel session mapping relationship is used to represent a mapping relationship between a channel and the session identifier, and the session identifier is associated with the application client.

In operation S230, push data is sent to the application client corresponding to the session identifier, so that the application client performs data update according to the push data.

According to the embodiment of the disclosure, the application system server may store in advance a channel session mapping relationship set including a plurality of channel session mapping relationships, each channel session mapping relationship being used to characterize a mapping relationship between a channel and a session identifier associated with the application client. For each application client, when the application client establishes a communication connection request with an application system server, the application client generates a session identifier, the session identifier is sent to the application system server along with the communication connection request, the application system server stores the session identifier, meanwhile, the communication connection request may further include request parameters, the request parameters may include service parameters and/or a channel requesting connection, and the application system server establishes a mapping relationship between the channel requesting connection and the session identifier to obtain a channel session mapping relationship.

According to the embodiment of the disclosure, the application system server and the application client can be in communication connection based on a full-duplex communication protocol, so that after acquiring the push data, the application system server can determine the session identifier corresponding to the target channel according to the channel session mapping relationship set, actively send the push data to the application client corresponding to the session identifier, and the application client updates data according to the push data.

According to the technical scheme of the embodiment of the disclosure, by obtaining a subscription notification, the subscription notification comprises a target channel and push data from the target channel, a session identifier corresponding to the target channel is determined according to a channel session mapping relationship set, the channel session mapping relationship set comprises a plurality of channel session mapping relationships, each channel session mapping relationship is used for representing a mapping relationship between a channel requesting connection and the session identifier, the session identifier is associated with an application client, and the push data is sent to the application client corresponding to the session identifier, so that the application client performs data update according to the push data. The application system server does not need to pull data and can actively send the push data to the application client, so that the time consumed by a pulling period is reduced, and meanwhile, the application client does not need to send a data acquisition request, so that the time consumed by network communication is reduced, the technical problem that the scene requirement with higher requirements on the data updating effectiveness is difficult to meet by adopting related technologies is at least partially overcome, and the effectiveness of the data updating is improved.

According to an embodiment of the present disclosure, the data updating method may further include the following operations.

The method comprises the steps of receiving communication connection requests based on a full-duplex communication protocol sent by at least one application client, wherein each communication connection request comprises a session identification and request parameters, the request parameters comprise a channel requesting connection and/or service parameters, and the service parameters are used for determining push data of the channel requesting connection. In response to each communication connection request, a communication connection is established with the application client and with the channel requesting the connection.

According to the embodiment of the disclosure, in order to meet the scene requirement with a high requirement on the data update realizability, the communication connection between the application system server and the application client can be realized based on the stateful protocol, that is, after the communication connection is established between the application system server and the application client, the communication connection between the application system server and the application client continuously maintains the connection state until the connection is terminated by any party (the application system server or the application client), so as to reduce the time consumed by network communication. On this basis, in order to enable the application system server to actively send push data to the application client, a mode that the application system server and the application client realize communication connection based on a full-duplex communication protocol may be adopted. Wherein the full duplex communication protocol may include Websocket.

The application system server may establish a communication connection with at least one application client, receive communication connection requests sent by the at least one application client based on a full-duplex communication protocol, each communication connection request may include a session identifier associated with the application client and request parameters, and the request parameters may include a service parameter for push data determining a channel for which a connection is requested and/or a channel for which a connection is requested. And the application system server establishes communication connection with each application client.

According to an embodiment of the present disclosure, the request parameters include traffic parameters. The data update method may further include the following operations.

And determining the channel requesting connection according to the service parameters. A communication connection is established with the channel requesting the connection. And establishing a mapping relation between the channel requesting connection and the session identifier to obtain a channel session mapping relation. And obtaining a channel session mapping relation set according to the plurality of channel session mapping relations.

According to the embodiment of the disclosure, if the requested connection includes the service parameter, the application system server may determine the channel of the requested connection according to the service parameter. In addition, the push data sent by the application system server to the application client is determined according to the service parameters. Exemplary, business parameters include, for example, order number, order time, and transaction snapshot. And the application system server determines the channel requesting connection as the channel providing the order information according to the service parameters.

After determining the channel requesting connection, the application system server may establish a communication connection with the channel requesting connection, where the channel requesting connection and the application system server may be a communication connection implemented based on a full duplex communication protocol. The application system server also stores a session identification associated with the application client included in the communication connection request. Aiming at each communication connection request, the application system server side establishes a mapping relation between a channel requested to be connected by the application client side and a session identifier associated with the application client side to obtain a channel session mapping relation. And obtaining a channel session mapping relation set according to the plurality of channel session mapping relations.

According to an embodiment of the present disclosure, the request parameter includes a channel and a service parameter of the request connection, or a channel of the request connection. The method may further include the following operations.

A communication connection is established with the channel requesting the connection. And establishing a mapping relation between the channel and the session identifier to obtain a channel session mapping relation. And obtaining a channel session mapping relation set according to the plurality of channel session mapping relations.

According to the embodiment of the disclosure, if the request parameter includes a channel and a service parameter of the requested connection, or the request parameter includes a channel of the requested connection, the application system server may establish a communication connection with the channel of the requested connection, where the channel of the requested connection and the application system server may be a communication connection implemented based on a full duplex communication protocol. It should be noted that, if the request parameter includes the channel requesting the connection, the push data may be considered to include all data of the channel requesting the connection.

According to the embodiment of the disclosure, the push data from the target channel is obtained by processing the original data by using a streaming calculation method. Or the push data from the target channel is obtained by processing the original data by the data processing server side by using a streaming computing method.

According to the embodiment of the disclosure, in order to meet the scene requirement with a high requirement on the effectiveness of data updating, a streaming computing method may be adopted to implement real-time computing, that is, the push data from the target channel is obtained by the application system server processing the original data by using the streaming computing method, or the data processing terminal processes the original data by using the streaming computing method to obtain the push data and sends the push data to the application system server. The streaming computing method may include Apache Storm, Apache Smaza, or Flink, among others. Optionally, the streaming computing method comprises Flink.

According to an embodiment of the present disclosure, sending push data to an application client corresponding to a session identifier, so that the application client performs data update according to the push data, may include the following operations.

And sending push data to the application client corresponding to the session identifier so that the application client updates and displays the data according to the push data.

According to the embodiment of the disclosure, after the application system server sends the push data to the application client corresponding to the session identifier, the application client can update the data according to the push data and display the updated data.

According to the embodiment of the disclosure, the data acquisition mode is changed from the pull mode to the push mode, so that the pull period and the time consumed by network communication are reduced, the effectiveness of data updating is further improved, and the updated data can be displayed in real time. Aiming at scenes with high requirements on data updating effectiveness, such as large screens, the technical scheme provided by the embodiment of the disclosure can realize millisecond-level data updating display.

According to an embodiment of the present disclosure, determining a session identifier corresponding to a target channel according to a channel session mapping relationship set may include the following operations.

And determining the channels matched with the target channels from the channel session mapping relation set to obtain the matched channels. And determining the session identifier corresponding to the matched channel as the session identifier corresponding to the target channel.

According to an embodiment of the present disclosure, the channel session mapping relationship set includes a plurality of channel session mapping relationships, each channel session mapping relationship being used to characterize a mapping relationship between a channel requesting a connection and a session identifier. After obtaining the target channel, the application system server may determine, from the channel session mapping relationship set, a channel that matches the target channel to obtain a matching channel, determine a session identifier corresponding to the matching channel, and determine the session identifier corresponding to the matching channel as the session identifier corresponding to the target channel.

According to an embodiment of the present disclosure, the full-duplex communication protocol includes Websocket.

According to the embodiment of the disclosure, the application system server receives the communication connection requests based on the Websocket sent by at least one application client, and the application system server responds to each communication connection request and establishes communication connection with each application client, so that after the application system server establishes communication connection with the application clients, the application system server can return the update data after passively receiving the data acquisition requests of the application clients, and actively sends the push data to the application clients when new data is generated.

According to the embodiment of the disclosure, the application system server comprises a memory database, and the push data is stored in the memory database.

According to the embodiment of the disclosure, in order to improve data read-write performance, a memory database may be used to store push data. The in-memory database may include Redis. Redis is a distributed key-value pair database with the capability of fast access and publishing subscription notifications.

FIG. 3 schematically shows a block diagram of a data update system according to an embodiment of the present disclosure.

As shown in fig. 3, the data updating system includes an application client, an application system server, and a data processing server. The application system server may include a Redis server and a Redis client. The application client and the Redis client are in communication connection based on the Websocket.

According to the embodiment of the disclosure, the data processing terminal is configured to process the original data by using a stream computing method to obtain push data, and send the push data to the Redis server, and the Redis server stores the push data to a corresponding channel. The Redis client may subscribe to a target channel in the Redis server. And under the condition that a target channel of the Redis server receives new data, the Redis server sends a subscription notification to a Redis client subscribing the target channel so that the Redis client sends the pushed data to the corresponding application client.

Fig. 4 schematically shows a signaling diagram of a data updating method according to an embodiment of the present disclosure. The data update method may be applied to the data update system shown in fig. 3.

As shown in fig. 4, the method includes operations S401 to S413.

In operation S401, each application client sends a Websocket-based communication connection request to a Redis client, where each communication connection request includes a session identifier and request parameters, the request parameters include a connection requesting channel and service parameters, and the service parameters are used to determine push data of the connection requesting channel.

In operation S402, the Redis client establishes a communication connection with the application client and a communication connection with a channel requesting a connection in response to each communication connection request.

In operation S403, the Redis client establishes a mapping relationship between the channel requesting connection and the session identifier, and obtains a channel session mapping relationship.

In operation S404, the Redis client obtains a set of channel session mapping relationships according to the multiple channel session mapping relationships.

In operation S405, the data processing server acquires raw data.

In operation S406, the data processing server processes the original data by using a streaming computing method, so as to obtain the pushed data.

In operation S407, the data processing server sends the push data to a Redis server in the application system server.

In operation S408, the Redis server stores the push data to the corresponding channel.

In operation S409, the Redis server sends a push notification to a Redis client in the application system server, where the push notification includes the target channel and push data from the target channel.

In operation S410, the Redis client determines a channel matching the target channel from the channel session mapping relationship set, and obtains a matching channel.

In operation S411, the Redis client determines a session identifier corresponding to the matching channel as a session identifier corresponding to the target channel.

In operation S412, the Redis client sends push data to the application client corresponding to the session identifier.

In operation S413, the application client performs data update according to the pushed data and displays the data.

According to the technical scheme of the embodiment of the disclosure, the data acquisition mode is changed from the pull mode to the push mode, so that the time consumed by the pull cycle and the network communication is reduced, the effectiveness of data updating is further improved, and the updated data can be displayed in real time.

Fig. 5 schematically shows a block diagram of a data update apparatus according to an embodiment of the present disclosure.

As shown in fig. 5, the data updating apparatus 500 is disposed at the application system server, and the data updating apparatus 500 includes an obtaining module 510, a first determining module 520, and a sending module 530.

The obtaining module 510, the first determining module 520, and the sending module 530 are communicatively coupled.

An obtaining module 510, configured to obtain a subscription notification, where the subscription notification includes the target channel and push data from the target channel.

The first determining module 520 is configured to determine a session identifier corresponding to a target channel according to a channel session mapping relationship set, where the channel session mapping relationship set includes a plurality of channel session mapping relationships, each channel session mapping relationship is used to represent a mapping relationship between a channel requesting connection and the session identifier, and the session identifier is associated with an application client.

A sending module 530, configured to send the push data to the application client corresponding to the session identifier, so that the application client performs data update according to the push data.

According to the technical scheme of the embodiment of the disclosure, by obtaining a subscription notification, the subscription notification comprises a target channel and push data from the target channel, a session identifier corresponding to the target channel is determined according to a channel session mapping relationship set, the channel session mapping relationship set comprises a plurality of channel session mapping relationships, each channel session mapping relationship is used for representing a mapping relationship between a channel requesting connection and the session identifier, the session identifier is associated with an application client, and the push data is sent to the application client corresponding to the session identifier, so that the application client performs data update according to the push data. The application system server does not need to pull data and can actively send the push data to the application client, so that the time consumed by a pulling period is reduced, and meanwhile, the application client does not need to send a data acquisition request, so that the time consumed by network communication is reduced, the technical problem that the scene requirement with higher requirements on the data updating effectiveness is difficult to meet by adopting related technologies is at least partially overcome, and the effectiveness of the data updating is improved.

According to an embodiment of the present disclosure, the data updating apparatus 500 further includes a receiving module and a responding module.

The device comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving communication connection requests based on a full-duplex communication protocol sent by at least one application client, each communication connection request comprises a session identifier and request parameters, the request parameters comprise a channel requesting connection and/or service parameters, and the service parameters are used for determining push data of the channel requesting connection. And the response module is used for responding to each communication connection request and establishing communication connection with the application client.

According to an embodiment of the present disclosure, the request parameters include traffic parameters.

The data updating apparatus 500 further includes a second determining module, a first establishing module, a second establishing module, and a first obtaining module.

And the second determining module is used for determining the channel requesting the connection according to the service parameters. The first establishing module is used for establishing communication connection with the channel requesting connection. And the second establishing module is used for establishing the mapping relation between the channel requesting the connection and the session identifier to obtain the channel session mapping relation. The first obtaining module is used for obtaining a channel session mapping relationship set according to the plurality of channel session mapping relationships.

According to an embodiment of the present disclosure, the request parameters include a channel and service parameters of the requested connection. The data updating apparatus 500 further comprises a third establishing module, a fourth establishing module and a second obtaining module. And the third establishing module is used for establishing communication connection with the channel requesting the connection. And the fourth establishing module is used for establishing the mapping relation between the channel requesting the connection and the session identifier to obtain the channel session mapping relation. And the second obtaining module is used for obtaining a channel session mapping relationship set according to the plurality of channel session mapping relationships.

According to the embodiment of the disclosure, the push data from the target channel is obtained by processing the original data by using a streaming calculation method. Or the push data from the target channel is obtained by processing the original data by the data processing server side by using a streaming computing method.

According to an embodiment of the present disclosure, a transmitting module includes a transmitting unit.

And the sending unit is used for sending the push data to the application client corresponding to the session identifier so that the application client updates and displays the data according to the push data.

According to an embodiment of the present disclosure, a first determination module includes an obtaining unit and a determination unit.

And the obtaining unit is used for determining the channels matched with the target channels from the channel session mapping relation set to obtain the matched channels. And the determining unit is used for determining the session identifier corresponding to the matched channel as the session identifier corresponding to the target channel.

According to an embodiment of the present disclosure, the full-duplex communication protocol includes Websocket.

According to the embodiment of the disclosure, the application system server comprises a memory database, and the push data is stored in the memory database.

Any of the modules, units, or at least part of the functionality of any of them according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules and units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, units according to the embodiments of the present disclosure may be implemented at least partially as a hardware Circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a Circuit, or implemented by any one of three implementations of software, hardware, and firmware, or any suitable combination of any of them. Alternatively, one or more of the modules, units according to embodiments of the present disclosure may be implemented at least partly as computer program modules, which, when executed, may perform the respective functions.

For example, any number of the obtaining module 510, the first determining module 520, and the sending module 530 may be combined and implemented in one module/unit, or any one of the modules/units may be split into a plurality of modules/units. Alternatively, at least part of the functionality of one or more of these modules/units may be combined with at least part of the functionality of other modules/units and implemented in one module/unit. According to an embodiment of the present disclosure, at least one of the obtaining module 510, the first determining module 520, and the sending module 530 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware. Alternatively, at least one of the obtaining module 510, the first determining module 520 and the sending module 530 may be at least partially implemented as a computer program module, which when executed may perform a corresponding function.

It should be noted that the data updating apparatus portion in the embodiment of the present disclosure corresponds to the data updating method portion in the embodiment of the present disclosure, and the description of the data updating apparatus portion specifically refers to the data updating method portion, and is not repeated herein.

Fig. 6 schematically shows a block diagram of an application system server adapted to implement the above described method according to an embodiment of the present disclosure. The application server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.

As shown in fig. 6, the application server 600 according to the embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.

In the RAM 603, various programs and data necessary for the operation of the application server 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.

According to an embodiment of the present disclosure, the application server 600 may further include an input/output (I/O) interface 605, the input/output (I/O) interface 605 also being connected to the bus 604. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.

According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.

The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs that, when identified collectively, implement the methods according to embodiments of the present disclosure.

According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable Computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM) or flash Memory), a portable compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the preceding. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.

Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method provided by the embodiments of the present disclosure, when the computer program product runs on an application system server, the program code is configured to enable the application system server to implement the data updating method provided by the embodiments of the present disclosure.

The computer program, when executed by the processor 601, performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.

In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, downloaded and installed through the communication section 609, and/or installed from the removable medium 611. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.

In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In situations involving remote computing devices, the remote computing devices may be connected to the user computing device through any kind of Network, including a Local Area Network (LAN) or Wide Area Network (WAN), or may be connected to external computing devices (e.g., through the internet using an internet service provider).

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.

The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:信息处理方法、信息处理装置、电子设备和可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!