Cross-platform asynchronous message processing method and device, equipment and storage medium

A technology of asynchronous message and processing method, which is applied in the directions of multi-program device, electrical digital data processing, program control design, etc., can solve the problems of complex implementation, and achieve the effect of easy integration, highlighting substantive features, and high efficiency.

Pending Publication Date: 2022-05-27
SUZHOU LANGCHAO INTELLIGENT TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The advantage of this solution is that a single thread can manage multiple events, but the disadvan

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Cross-platform asynchronous message processing method and device, equipment and storage medium
  • Cross-platform asynchronous message processing method and device, equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0058]There are the following common asynchronous task implementation schemes: one is to create a thread for each task, so that other tasks can continue to run in the main thread, and in the message processing thread, waiting for the response of the message . The advantage of this scheme is that it is simple to implement, but the disadvantage is that each task needs to enable a separate thread, which consumes a lot of system resources when there are too many tasks. Another implementation scheme is to generate a device descriptor for each event, and then add the device descriptor to the system monitoring through the system's IO multiplexing technology to realize the notification of the response message. The advantage of this scheme is that a single thread can manage multiple events, but the disadvantage is that the implementation is complex, and different system implementations need to be adapted. In order to solve the problem of high system resource consumption, complex imple...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention belongs to the technical field of asynchronous task processing, and particularly provides a cross-platform asynchronous message processing method and device, equipment and a storage medium, and the method comprises the following steps: when a message is sent, registering the message and an overtime processing function of the message into a time wheel timer, adding the message into a red-black tree, and setting a reference count to be increased; receiving a response message, and judging whether an overtime processing function of the message is called or not; if not, inquiring a red-black tree to judge whether the message exists or not; if yes, obtaining a specific object in the red-black tree for response processing; if not, discarding the response message, and reducing the reference count; if yes, judging that the response is overtime, deleting the message from the red-black tree, and removing the message from the timed task at the same time; and when the reference count value is zero, destroying the object. The objects are managed by introducing reference counts, and it is guaranteed that the objects can be correctly released.

Description

technical field [0001] The invention relates to the technical field of asynchronous task processing, in particular to a cross-platform asynchronous message processing method, device, device and storage medium. Background technique [0002] At present, the commonly used asynchronous task implementation schemes are as follows: [0003] One is to create a thread for each task, so that other tasks can continue to run in the main thread, and in the message processing thread, waiting for the response of the message. The advantage of this scheme is that it is simple to implement, but the disadvantage is that each task needs to enable a separate thread, which consumes a lot of system resources when there are too many tasks. [0004] Another implementation scheme is to generate a device descriptor for each event, and then add the device descriptor to the system monitoring through the system's IO multiplexing technology to realize the notification of the response message. The advant...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F9/48
CPCG06F9/485Y02D10/00
Inventor 郎占坡穆向东
Owner SUZHOU LANGCHAO INTELLIGENT TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products