CN115174666A - Cross-frame cross-end message pushing method and device - Google Patents
Cross-frame cross-end message pushing method and device Download PDFInfo
- Publication number
- CN115174666A CN115174666A CN202210680620.9A CN202210680620A CN115174666A CN 115174666 A CN115174666 A CN 115174666A CN 202210680620 A CN202210680620 A CN 202210680620A CN 115174666 A CN115174666 A CN 115174666A
- Authority
- CN
- China
- Prior art keywords
- message
- cross
- message push
- protocol
- push device
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 28
- 238000004891 communication Methods 0.000 claims abstract description 19
- 238000012544 monitoring process Methods 0.000 claims abstract description 8
- 238000003339 best practice Methods 0.000 claims abstract description 5
- 238000012545 processing Methods 0.000 claims description 26
- 238000002347 injection Methods 0.000 claims description 10
- 239000007924 injection Substances 0.000 claims description 10
- 239000008186 active pharmaceutical agent Substances 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 4
- 238000012423 maintenance Methods 0.000 abstract description 4
- 206010021703 Indifference Diseases 0.000 description 7
- 238000011161 development Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 230000003993 interaction Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000009933 burial Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 238000011423 initialization method Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
Description
技术领域technical field
本发明属于消息推送开发技术领域,具体涉及一种跨框架的跨端消息推送方法及装置。The invention belongs to the technical field of message push development, and in particular relates to a cross-frame cross-end message push method and device.
背景技术Background technique
随着国在移动互联网蓬勃发展的趋势下,高并发与用户实时响应是移动端应用经常面临的问题,比如患者排号的实时信息、社交网络的实时消息推送等。消息推送已经成为了一种移动端开发的标准,然而想要实现移动端的实时消息推送,则必须使用一种高效节能的双向通信机制来保证数据的实时传输,如使用websocket协议作为通信协议。With the rapid development of the mobile Internet in China, high concurrency and real-time user response are often faced by mobile applications, such as real-time information on patient numbers and real-time message push in social networks. Message push has become a standard for mobile development. However, to achieve real-time message push on mobile, a high-efficiency and energy-saving two-way communication mechanism must be used to ensure real-time data transmission, such as using the websocket protocol as the communication protocol.
但是目前市场上的移动端终端众多,如android、ios、微信小程序、支付宝小程序、H5等,各端之间对websocket实现方式不同,接入方式也不同。在跨端技术中无法无差异接入多端通信,只能接入特定的终端,如socket.io常用作web端,socketTask常用作小程序,它们之间接入方式不同,api也不相同。并不能实现无差异接入任何终端,这样使得多端之间无法保证一致性,api调用方式、交互都会存在差异。目前传统的接入方式有四个缺点:①小程序环境下的消息装置无法复用到web端,若同个功能web端需要还得重新接入并开发;②各端之间的api(Application ProgrammingInterface,应用程序编程接口)不一致,使得维护多端变得困难,并且各端之间代码无法复用③若某个通信功能已经在某个终端(非当前终端)上开发过,此时并不能直接复用,而是得重新开发一个功能一模一样的装置;④每个终端都单独写一套单独的代码来实现消息推送功能,并不能保证各端之间实现的一致性,从可能导致一些意料之外的错误。而这些缺点的根本原因是,没有一个可以同时运行在任意终端的并提供多端无差异api的消息推送装置。However, there are many mobile terminals on the market at present, such as android, ios, WeChat applet, Alipay applet, H5, etc. The implementation methods of websocket are different between each terminal, and the access methods are also different. In cross-terminal technology, multi-terminal communication cannot be accessed indiscriminately, and only specific terminals can be accessed. For example, socket.io is often used as a web terminal, and socketTask is often used as a small program. The access methods between them are different, and the APIs are also different. It cannot achieve indiscriminate access to any terminal, which makes it impossible to guarantee consistency between multiple terminals, and there will be differences in API calling methods and interactions. At present, the traditional access method has four shortcomings: (1) The message device in the applet environment cannot be reused to the web side. If the same function web side needs to be re-connected and developed; (2) The api (Application ProgrammingInterface, application programming interface) is inconsistent, making it difficult to maintain multiple terminals, and the code cannot be reused between terminals ③ If a communication function has been developed on a terminal (not the current terminal), it cannot be directly It is necessary to re-develop a device with exactly the same function; ④ Each terminal writes a separate set of code to implement the message push function, which cannot guarantee the consistency of implementation between terminals, which may lead to some unexpected external error. The root cause of these shortcomings is that there is no message push device that can run on any terminal at the same time and provide multi-terminal indifference APIs.
针对上述的缺点,本发明要解决的问题或者想要达到的目的是:提供一个跨框架的跨端消息推送方法及装置,可以支持任意终端的消息推送接入,并提供一套各端无差异的api,由于websocket场景下的网络环境较为复杂,因此内置了一套高可用的中间件,如弱网通信、日志监控、心跳保活。开发者只需关注当前业务即可,无需过多的关注兼容性、特殊场景处理,开发出一套代码即可运行在任意终端,从而大大减少开发成本。In view of the above shortcomings, the problem to be solved or the purpose of the present invention is to provide a cross-frame cross-terminal message push method and device, which can support the message push access of any terminal, and provide a set of indifference between each terminal. api, due to the complex network environment in the websocket scenario, a set of high-availability middleware is built-in, such as weak network communication, log monitoring, and heartbeat keep-alive. Developers only need to pay attention to the current business, without paying too much attention to compatibility and special scene processing, and develop a set of code that can run on any terminal, thus greatly reducing development costs.
发明内容SUMMARY OF THE INVENTION
针对现有技术的不足,本发明的目的在于提供一种跨框架的跨端消息推送方法及装置,它可以同时运行在任意终端的并提供多端无差异api的消息推送装置包括:协议层消息推送装置、业务层消息推送装置。业务层消息推送装置依赖于协议层消息推送装置。协议层的消息推送装置无任何业务相关属性,也没有任何平台相关属性。业务层推送装置可以看作是协议层推送装置的最佳实践,任意移动端只需要初始化业务装置即可完成消息推送的接入。Aiming at the deficiencies of the prior art, the purpose of the present invention is to provide a cross-frame cross-end message push method and device, which can run on any terminal at the same time and provide a multi-end indifference api message push device including: protocol layer message push device, service layer message push device. The service layer message pushing device depends on the protocol layer message pushing device. The message push device at the protocol layer does not have any business-related attributes, nor does it have any platform-related attributes. The service layer push device can be regarded as the best practice of the protocol layer push device, any mobile terminal only needs to initialize the service device to complete the access of message push.
为实现一种可以同时运行在任意终端的并提供多端无差异api的消息推送系统,本发明采用如下的技术方案。In order to realize a message push system that can run on any terminal at the same time and provides multi-terminal indifference APIs, the present invention adopts the following technical solutions.
一种跨框架的跨端消息推送装置,其特征在于,包括协议层消息推送装置、业务层消息推送装置;A cross-frame cross-end message push device, characterized in that it includes a protocol layer message push device and a business layer message push device;
协议层消息推送装置无任何业务相关属性,也没有任何平台相关属性,业务层消息推送装置可以看作是协议层推送装置的最佳实践,任意移动端只需要初始化业务装置即可完成消息推送的接入;The protocol layer message push device does not have any business-related attributes, nor any platform-related attributes. The business layer message push device can be regarded as the best practice of the protocol layer push device. Any mobile terminal only needs to initialize the service device to complete the message push. access;
协议层消息推送装置提供一套各端无差异的api,并内置了一套高可用的中间件包括弱网通信、日志监控、心跳保活。The protocol layer message push device provides a set of APIs that are indistinguishable from each end, and has a built-in set of high-availability middleware including weak network communication, log monitoring, and heartbeat keep-alive.
进一步的,所述协议层消息推送装置,是将所约定的协议进行封装,封装成一个协议层的基础消息推送装置;Further, the protocol layer message push device is a basic message push device that encapsulates the agreed protocol and encapsulates it into a protocol layer;
具体地分为以下步骤:①实现一个通用的socket实例容器;②运行时实例注入;③注册高可用处理器;④实现消息管理器。Specifically, it is divided into the following steps: 1) implement a general socket instance container; 2) run-time instance injection; 3) register a high-availability processor; 4) implement a message manager.
进一步的,所述socket实例容器包括但不限于兼容android、ios、微信小程序、支付宝小程序、H5状态下socket的实例,并实现统一api;Further, the socket instance container includes, but is not limited to, an instance that is compatible with android, ios, WeChat applet, Alipay applet, and socket in H5 state, and implements a unified api;
所述运行时实例的注入,包括但不限于使用stomp的over来实现注入;The injection of the runtime instance, including but not limited to using the over of stomp to achieve injection;
所述高可用处理器包括但不限于心跳保活处理器、消息合并处理器、弱网通信处理器、指标观察处理器;The high-availability processors include but are not limited to heartbeat keep-alive processors, message merging processors, weak network communication processors, and indicator observation processors;
所述消息管理器包括但不限于提供一套完整的config(初始化配置项)和api。The message manager includes but is not limited to providing a complete set of config (initialization configuration item) and api.
进一步的,所述业务层消息推送装置具体处理消息过程分为以下步骤:①初始化基础装置②注册业务层的处理器③提供一套初始化配置和api。Further, the specific message processing process of the service layer message push device is divided into the following steps: 1. initialize the basic device, 2. register the processor of the service layer, and 3. provide a set of initialization configuration and api.
进一步的,所述注册业务层的处理器包括但不限于:身份认证、埋点、发布订阅装置、debug。Further, the processor of the registration service layer includes but is not limited to: identity authentication, tracking, publish-subscribe device, and debug.
一种跨框架的跨端消息推送方法,其特征在于,包括以下步骤:A cross-frame cross-end message push method, characterized in that it comprises the following steps:
步骤1:服务端与客户端约定子协议,遵循约定子协议服务端向客户端推送消息;Step 1: the server and the client agree on a sub-protocol, and the server pushes a message to the client according to the agreed sub-protocol;
步骤2:客户端依照步骤1中约定的子协议通过协议层消息推送装置完成跨多端的基础层消息处理生成基础装置;Step 2: the client completes the base layer message processing across multiple terminals through the protocol layer message push device according to the sub-protocol agreed in the step 1 and generates a base device;
步骤3:根据步骤2中所提供的基础装置通过业务层消息推送装置完成业务层消息处理;Step 3: complete business layer message processing by business layer message push device according to the basic device provided in step 2;
步骤4:客户端将服务端推送的消息进行分发,分发到指定端侧;Step 4: the client distributes the message pushed by the server, and distributes it to the designated terminal;
步骤5:端侧收到消息,进行数据更新,视图渲染。Step 5: The device side receives the message, updates the data, and renders the view.
进一步的,步骤1中所约定的子协议包括但不限于stomp、socket.io。Further, the sub-protocols agreed in step 1 include but are not limited to stomp and socket.io.
进一步的,步骤2中所述的跨多端的基础消息处理的处理器包括消息合并处理器、弱网通信处理器、指标观察处理器、心跳保活处理器、断线重连处理器;Further, the processor for processing basic messages across multiple terminals described in step 2 includes a message merging processor, a weak network communication processor, an indicator observation processor, a heartbeat keep-alive processor, and a disconnection and reconnection processor;
通过运行时能力注入如android、ios、微信小程序、支付宝小程序、H5等特定终端的Socket实例;并提供无差异api,可定制的config;然后进行提纯处理,使其不包含任何环境相关内容,形成协议层装置。通过这里运行时注入的处理,编译时将不包含任何平台相关信息,至此基础的协议层装置将可以搭载到任意终端上。Inject Socket instances of specific terminals such as android, ios, WeChat applet, Alipay applet, H5 and other specific terminals through runtime capabilities; and provide indifference api, customizable config; and then purify it so that it does not contain any environment-related content , to form a protocol layer device. Through the processing of runtime injection here, the compilation will not contain any platform-related information, and the basic protocol layer device will be able to be mounted on any terminal.
进一步的,步骤2中所述的基础装置是根据特定领域语言编写,其展现形式类似中间语言,而且本发明重点不在编译DSL,故需要借助市面上一些跨端框架能力来完成DSL的编译工作,使其编译成特定终端的代码。Further, the basic device described in step 2 is written according to a specific domain language, and its presentation form is similar to an intermediate language, and the focus of the present invention is not to compile the DSL, so it is necessary to use some cross-end framework capabilities on the market to complete the DSL compilation work, Make it compile to code for a specific terminal.
进一步的,步骤3中所述的业务层消息处理包括但不限于:鉴权认证处理、埋点处理、触发器、mock能力等进一步处理,将这些处理加入步骤2中产生的协议层装置上,并根据协议层装置提供的无差异api将其形成业务层装置,包含初始化方式、业务中间件等Further, the business layer message processing described in step 3 includes, but is not limited to, further processing such as authentication and authentication processing, buried point processing, triggers, mock capabilities, etc., adding these processing to the protocol layer device generated in step 2, And according to the indifference api provided by the protocol layer device, it is formed into a business layer device, including initialization methods, business middleware, etc.
进一步的,在执行步骤4之前,需要将步骤3的业务层装置进行初始化,初始化项包括与服务端约定的服务端口,订阅的频道。Further, before step 4 is performed, the business layer device in step 3 needs to be initialized, and the initialization items include the service port agreed with the server and the subscribed channel.
进一步的,步骤5所述的端侧接收到已经经过处理的消息后,直接渲染即可,无需关注协议层和业务层处理。Further, after receiving the processed message in step 5, the terminal side can directly render the message without paying attention to the processing of the protocol layer and the business layer.
与现有技术相比,本发明的有益效果是:Compared with the prior art, the beneficial effects of the present invention are:
1、由于只用维护一份代码,使得监控变得容易,更加便于将所有通信收口,也使得指标的收集维护变得简单。1. Since only one code is required to be maintained, monitoring becomes easier, it is more convenient to close all communications, and the collection and maintenance of indicators becomes simple.
2、由于只用维护一份代码,而且各端之间的api一致,使得维护多端变得简单,一端调试完成即所有端可用。2. Since only one code is needed to be maintained, and the APIs between each end are consistent, it is easy to maintain multiple ends, and all ends are available after debugging at one end.
3、由于只用维护一份代码,若某个通信功能已经在某个终端(非当前终端)上开发过,此时可直接复用,无需重新开发,节省人力。3. Since only one code needs to be maintained, if a certain communication function has been developed on a certain terminal (not the current terminal), it can be reused directly at this time, without re-development, saving manpower.
4、由于只用维护一份代码,多端交互一致性变得容易,传统的方式多端之间需要花大量的时间来比对交互一致性。4. Due to the maintenance of only one code, the multi-terminal interaction consistency becomes easy, and the traditional method requires a lot of time to compare the interaction consistency between the multi-terminals.
5、由于只用维护一份代码,消息的稳定性、时序性、弱网处理等,一系列费时费力的高可用处理统一,不需花费过多人力,可大大节省人力。5. Since only one code is needed to maintain, the stability of messages, timing, weak network processing, etc., a series of time-consuming and labor-intensive high-availability processing is unified, and it does not need to spend too much manpower, which can greatly save manpower.
附图说明Description of drawings
图1为本发明的一种跨框架的跨端消息推送方法的流程图;1 is a flowchart of a cross-frame cross-terminal message push method according to the present invention;
图2为本发明的一种跨框架的跨端消息推送方法的架构图;2 is an architectural diagram of a cross-frame cross-end message push method according to the present invention;
具体实施方式Detailed ways
请参阅图1-2所示的一种跨框架的跨端消息推送方法及装置,它是可以支持任意终端的消息推送接入,并提供一套各端无差异的api,由于websocket场景下的网络环境较为复杂,因此内置了一套高可用的中间件,如弱网通信、日志监控、心跳保活。开发者只需关注当前业务即可,无需过多的关注兼容性、特殊场景处理,开发出一套代码即可运行在任意终端,从而大大减少开发成本的一种跨框架的跨端消息推送方法及装置。Please refer to a cross-frame cross-end message push method and device shown in Figure 1-2. It can support message push access of any terminal, and provides a set of APIs that are indistinguishable from each end. The network environment is complex, so a set of high-availability middleware is built-in, such as weak network communication, log monitoring, and heartbeat keep-alive. Developers only need to pay attention to the current business, without paying too much attention to compatibility and special scene processing, and develop a set of code that can run on any terminal, thereby greatly reducing development costs. A cross-frame cross-end message push method and device.
具体地,1.一种跨框架的跨端消息推送装置,包括协议层消息推送装置、业务层消息推送装置,协议层消息推送装置无任何业务相关属性,也没有任何平台相关属性,业务层消息推送装置可以看作是协议层推送装置的最佳实践,任意移动端只需要初始化业务装置即可完成消息推送的接入,协议层消息推送装置提供一套各端无差异的api,并内置了一套高可用的中间件包括弱网通信、日志监控、心跳保活。Specifically, 1. a cross-frame cross-end message push device, comprising a protocol layer message push device and a business layer message push device, the protocol layer message push device does not have any business-related attributes, nor does it have any platform-related attributes, business layer messages The push device can be regarded as the best practice of the protocol layer push device. Any mobile terminal only needs to initialize the service device to complete the access of the message push. The protocol layer message push device provides a set of APIs that are indistinguishable from each end, and has built-in A set of high-availability middleware includes weak network communication, log monitoring, and heartbeat keep-alive.
协议层消息推送装置,是将所约定的协议进行封装,封装成一个协议层的基础消息推送装置,具体地分为以下步骤:①实现一个通用的socket实例容器;②运行时实例注入;③注册高可用处理器;④实现消息管理器。The protocol layer message push device is a basic message push device that encapsulates the agreed protocol and encapsulates it into a protocol layer. Specifically, it is divided into the following steps: 1) Realize a general socket instance container; 2) Runtime instance injection; 3) Registration High availability processor; ④ implement message manager.
其中,socket实例容器包括但不限于兼容android、ios、微信小程序、支付宝小程序、H5状态下socket的实例,并实现统一api;运行时实例的注入,包括但不限于使用stomp的over来实现注入;高可用处理器包括但不限于心跳保活处理器、消息合并处理器、弱网通信处理器、指标观察处理器;消息管理器包括但不限于提供一套完整的config(初始化配置项)和api。Among them, the socket instance container includes but is not limited to compatible with android, ios, WeChat applet, Alipay applet, socket instance in H5 state, and realizes a unified api; the injection of the runtime instance, including but not limited to the use of stomp over to achieve Injection; high-availability processors include but are not limited to heartbeat keep-alive processors, message merging processors, weak network communication processors, and indicator observation processors; message managers include but are not limited to providing a complete set of config (initialization configuration items) and api.
业务层消息推送装置具体处理消息过程分为以下步骤:①初始化基础装置②注册业务层的处理器③提供一套初始化配置和api,其中注册业务层的处理器包括但不限于:身份认证、埋点、发布订阅装置、debug。The specific processing message process of the business layer message push device is divided into the following steps: 1. initialize the basic device 2. the processor of the registered business layer 3. provide a set of initialization configuration and api, wherein the processor of the registered business layer includes but is not limited to: identity authentication, burial point, publish-subscribe device, debug.
一种跨框架的跨端消息推送方法,包括以下步骤:A cross-frame cross-end message push method, comprising the following steps:
步骤1:服务端与客户端约定子协议,遵循约定子协议服务端向客户端推送消息;Step 1: the server and the client agree on a sub-protocol, and the server pushes a message to the client according to the agreed sub-protocol;
步骤2:客户端依照步骤1中约定的子协议通过协议层消息推送装置完成跨多端的基础层消息处理生成基础装置;Step 2: the client completes the base layer message processing across multiple terminals through the protocol layer message push device according to the sub-protocol agreed in the step 1 and generates a base device;
步骤3:根据步骤2中所提供的基础装置通过业务层消息推送装置完成业务层消息处理;Step 3: complete business layer message processing by business layer message push device according to the basic device provided in step 2;
步骤4:客户端将服务端推送的消息进行分发,分发到指定端侧;Step 4: the client distributes the message pushed by the server, and distributes it to the designated terminal;
步骤5:端侧收到消息,进行数据更新,视图渲染。Step 5: The device side receives the message, updates the data, and renders the view.
步骤1中,服务端客户端约定子协议,如约定使用stomp(Simple Text OrientatedMessaging Protocol,简单文本定向消息协议)作为子协议,然后服务端将以stomp协议的方式向客户端推送消息。In step 1, the server client agrees on a sub-protocol, for example, stomp (Simple Text Orientated Messaging Protocol, Simple Text Oriented Messaging Protocol) is used as the sub-protocol, and then the server will push messages to the client in the form of the stomp protocol.
步骤2中,依据步骤1中所约定的协议stomp,将基于stomp协议进行封装,封装一个协议层的基础消息推送装置。具体地分为以下步骤:①进行去平台内容处理,将所有平台相关的内容去除,然后实现完成一个通用的socket实例容器,在容器里抹平所有平台的api,然后透出一个统一api的socket实例;②特定的socket实例在运行时确定,具体地这里在运行时通过stomp的over属性进行实例的注入,以实现多终端的无差异性;③有了前面的基座,在基座之上需要实现高可用的处理器,来弥补协议的缺陷,有以下核心处理器:a.心跳保活处理,这里为了避免造成大量的心跳浪费,和心跳潮汐的出现,采用智能心跳的方式,更好的来权衡消息的及时性和性能,以及debounce(防抖)来实现不占用消息通道,心跳取值2000ms。b.消息合并处理器,将同一时间段的消息进行合并处理,具体地设置并发阈值,超过阈值即合并。c.弱网通信处理器,根据移动网络环境和断线重连连续次数,来进行降级处理。d.指标观察处理器,用于检测装置的健康状态,进行异常上报,如异常录制,异常回溯。除以上核心处理器,还另外提供非核心处理器的拓展入口,非核心处理器采用plugin(插件)的方式实现,做到切面试拓展,不影响核心;④实现MessageManager(消息管理器)将前面提供的处理器注册到管理器中,并提供一套完整的config(初始化配置项)和api。到此为止一个基础的协议层消息装置即可完成。In step 2, according to the protocol stomp agreed in step 1, the stomp-based protocol is encapsulated, and a basic message push device of a protocol layer is encapsulated. Specifically, it is divided into the following steps: 1. Carry out the content processing of the platform, remove all platform-related content, and then implement a general socket instance container, smooth the api of all platforms in the container, and then reveal a unified api socket Instance; 2. The specific socket instance is determined at runtime. Specifically, the instance is injected through the over attribute of stomp at runtime to realize the indifference of multiple terminals; 3. With the front base, on the base It is necessary to implement a highly available processor to make up for the shortcomings of the protocol. There are the following core processors: a. Heartbeat keep-alive processing, in order to avoid a lot of heartbeat waste and the appearance of heartbeat tides, the smart heartbeat method is used, which is better To balance the timeliness and performance of the message, and debounce (anti-shake) to achieve not occupying the message channel, the heartbeat value is 2000ms. b. The message merging processor, which merges the messages in the same time period, specifically sets the concurrency threshold, and merges when the threshold is exceeded. c. The weak network communication processor performs downgrade processing according to the mobile network environment and the consecutive times of disconnection and reconnection. d. The indicator observation processor is used to detect the health state of the device and report abnormality, such as abnormal recording and abnormal backtracking. In addition to the above core processors, the expansion entry for non-core processors is also provided. The non-core processors are implemented in the form of plugins, so as to cut interviews and expand without affecting the core; The provided processor is registered with the manager and provides a complete set of config (initialization configuration items) and api. So far, a basic protocol layer message device can be completed.
步骤3中,需要依赖步骤2中所提供的基础层装置,具体分为以下步骤:①初始化基础装置,将config中的拓展选项做一层桥接再透出去。②注册业务层的处理器,核心处理器(此处与主题关系不大只列举不做详细阐述):身份认证能力、埋点能力、发布订阅能力、调试能力等。③提供一套初始化配置,包括但不限于:run(运行)、destroy(销毁)、config(配置)、bizMiddleware(业务中间件)、triggerMiddleware(消息触发中间件)。In step 3, it is necessary to rely on the basic layer device provided in step 2, which is divided into the following steps: 1. Initialize the basic device, and make a layer of bridging options in the config before revealing it. ②Register the processor of the business layer, the core processor (here, it has little to do with the topic, only enumerates and does not elaborate): identity authentication ability, buried point ability, publish and subscribe ability, debugging ability, etc. ③ Provide a set of initialization configuration, including but not limited to: run (run), destroy (destroy), config (configuration), bizMiddleware (business middleware), triggerMiddleware (message-triggered middleware).
步骤4中,需要将步骤3中提供的消息装置进行初始化,进行config的配置并运行,此阶段可接收到来自服务端的消息推送,在接受到消息后会根据消息类型将消息分发到各个订阅业务页面上。此时的消息装置已经是可初始化到众多终端上的,如Android、ios、微信小程序、支付宝小程序、H5等,都已经可以无差异使用。并且所有终端只用维护一个步骤3中所述的消息推送装置即可,且提供可拓展的方式。若要拓展更多终端,只需在步骤2中所述的协议层消息装置的socket容器增加并兼容该端侧的实例即可,上层无需改动,也无感知.若需要定制化的消息推送需求,只需在特定业务层注入步骤2中所述的plugin即可。In step 4, it is necessary to initialize the message device provided in step 3, configure config and run it. At this stage, the message push from the server can be received, and after receiving the message, the message will be distributed to each subscription service according to the message type. on the page. At this time, the message device can already be initialized to many terminals, such as Android, ios, WeChat applet, Alipay applet, H5, etc., all of which can be used without distinction. And all terminals only need to maintain one message push device described in step 3, and provide an expandable way. If you want to expand more terminals, you only need to add the socket container of the protocol layer message device described in step 2 and be compatible with the instance on the terminal side. The upper layer does not need to be changed or sensed. If you need customized message push requirements , just inject the plugin described in step 2 in the specific business layer.
步骤5中,各端侧业务页面接收到消息,进行视图渲染,完成消息的消费。In step 5, each end-side business page receives the message, renders the view, and completes the consumption of the message.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210680620.9A CN115174666A (en) | 2022-06-15 | 2022-06-15 | Cross-frame cross-end message pushing method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210680620.9A CN115174666A (en) | 2022-06-15 | 2022-06-15 | Cross-frame cross-end message pushing method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115174666A true CN115174666A (en) | 2022-10-11 |
Family
ID=83485071
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210680620.9A Pending CN115174666A (en) | 2022-06-15 | 2022-06-15 | Cross-frame cross-end message pushing method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115174666A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116170496A (en) * | 2022-12-05 | 2023-05-26 | 上海金融期货信息技术有限公司 | Unified business message push method based on WebSocket |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060149840A1 (en) * | 2005-01-06 | 2006-07-06 | Tervela, Inc. | End-to-end publish/subscribe middleware architecture |
| CN103501321A (en) * | 2013-09-23 | 2014-01-08 | 浙江工业大学 | Remote multimedia network transmission platform |
| CN106506519A (en) * | 2016-11-21 | 2017-03-15 | 辽宁科技大学 | System and method for cross-platform communication of WCF framework net.tcp protocol |
| CN112311893A (en) * | 2020-11-09 | 2021-02-02 | 成都市软件产业发展中心(成都信息化技术应用发展中心) | Cross-region, business and system data service middleware and data verification method |
| CN113703772A (en) * | 2021-08-23 | 2021-11-26 | 北京计算机技术及应用研究所 | Efficient intelligent computing application architecture of heterogeneous platform based on ICE (Internet communications Engineers) and construction method thereof |
| CN114500638A (en) * | 2022-01-04 | 2022-05-13 | 创业慧康科技股份有限公司 | Medical data stream pushing system and method based on automatic cross-platform |
-
2022
- 2022-06-15 CN CN202210680620.9A patent/CN115174666A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060149840A1 (en) * | 2005-01-06 | 2006-07-06 | Tervela, Inc. | End-to-end publish/subscribe middleware architecture |
| CN103501321A (en) * | 2013-09-23 | 2014-01-08 | 浙江工业大学 | Remote multimedia network transmission platform |
| CN106506519A (en) * | 2016-11-21 | 2017-03-15 | 辽宁科技大学 | System and method for cross-platform communication of WCF framework net.tcp protocol |
| CN112311893A (en) * | 2020-11-09 | 2021-02-02 | 成都市软件产业发展中心(成都信息化技术应用发展中心) | Cross-region, business and system data service middleware and data verification method |
| CN113703772A (en) * | 2021-08-23 | 2021-11-26 | 北京计算机技术及应用研究所 | Efficient intelligent computing application architecture of heterogeneous platform based on ICE (Internet communications Engineers) and construction method thereof |
| CN114500638A (en) * | 2022-01-04 | 2022-05-13 | 创业慧康科技股份有限公司 | Medical data stream pushing system and method based on automatic cross-platform |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116170496A (en) * | 2022-12-05 | 2023-05-26 | 上海金融期货信息技术有限公司 | Unified business message push method based on WebSocket |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112637318B (en) | Intelligent gateway system and device for storage integrity and control method thereof | |
| US7676791B2 (en) | Implementation of concurrent programs in object-oriented languages | |
| CN103176789A (en) | Method and system used for realizing function extension of open platform | |
| CN103150154B (en) | The implementation method and device of a kind of application plug | |
| CN106933589B (en) | Message queue assembly based on configuration and integration method thereof | |
| CN105138398A (en) | SOCKET communication and process management common platform and method under synchronous communication mode | |
| CN103546476A (en) | Transmission method and system for information between page assemblies | |
| CN114741400A (en) | Data synchronization and analysis method, device and terminal equipment | |
| US10657073B2 (en) | Driver module framework enabling creation and execution of reliable and performant drivers | |
| CN113835904A (en) | Remote procedure call control method, device, equipment and storage medium | |
| CN115174666A (en) | Cross-frame cross-end message pushing method and device | |
| CN110781014B (en) | Recording data multi-process distribution method and system based on Android device | |
| CN103513990A (en) | Method for designing high-performance generally-used network framework for distributed processing | |
| CN101963924A (en) | Process communication method, device and operating system | |
| CN111124883A (en) | Method, system and device for introducing test case library based on tree table | |
| CN105897884A (en) | Android mobile phone push platform based on eXtensive messaging presence protocol (XMPP) | |
| CN103763325B (en) | Method for building IP security product development environment | |
| CN114327404A (en) | File processing method and device, electronic equipment and computer readable medium | |
| CN110262912B (en) | Calling method and device for procedure call gRPC | |
| US20140297801A1 (en) | Method, apparatus and system for simultaneously transmitting or receiving multiple managed objects | |
| CN111782289A (en) | Adams software-based collaboration method, system, computer device and storage medium | |
| CN117971760A (en) | Edge computing device framework systems, chips, storage media, and apparatus | |
| CN111459819A (en) | Software testing method and device, electronic equipment and computer readable medium | |
| CN118035154A (en) | Module communication method and device, electronic equipment and storage medium | |
| CN106844156B (en) | WCF communication message interception method in intelligent building integrated management platform system |
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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20221011 |