A queue port communication method based on port list

A port list and port communication technology, which is applied in inter-program communication, instruments, multi-program devices, etc., can solve the problems of untimely message processing and waste of CPU resources, and achieve the effect of improving efficiency and saving computing resources

Pending Publication Date: 2019-03-29
XIAN AVIATION COMPUTING TECH RES INST OF AVIATION IND CORP OF CHINA
5 Cites 0 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0004] Purpose of the present invention: the present invention provides a queue port communication method based on the port list, and the purpose is to solve the waste of CPU resources and message processin...
View more

Method used

Step 4: monitor and process a plurality of purpose ports simultaneously by port list receiving service, manage port list semaphore according to the destination port in port list whether message can be received and its status change, finally realize the visit to port list manage.
[0018] The destination port in the port service list can be set to active state (ACTIVE) or inacti...
View more

Abstract

The invention belongs to the technical field of computer system software, and relates to a queue port communication method based on port list, which is used for solving the problems of CPU resource waste and message processing delay caused by adopting polling mode when a partition process needs to listen and process multiple destination port messages at the same time in an embedded real-time partitioned operating system. The invention provides a queue port communication method based on a port list, which comprises two key aspects: one is to realize simultaneous monitoring and processing of a group of destination ports by an intra-zone process through the port list; the other is to provide a queue port communication method based on the port list. 2. According to whether that destination port has message for receiving and state transition, the access control to the port list is realized by managing the semaphore of the port list. After the queue port communication method designed by theinvention is implemented, the CPU calculation resources can be saved and the message processing efficiency can be improved under the scenario that the partition process needs to simultaneously monitorand process a plurality of destination ports.

Application Domain

Interprogram communicationHardware monitoring

Technology Topic

Processing delayReal-time computing +5

Image

  • A queue port communication method based on port list

Examples

  • Experimental program(1)

Example Embodiment

[0012] A queue port communication method based on a port list includes the following steps:
[0013] Step 1: Create a queue port port list, initially empty
[0014] When creating a queue port list, specify the maximum number of destination ports allowed to join this port list, create storage space, and create a counting semaphore for this port list, the initial value of the semaphore is 0;
[0015] Step 2: Add the destination ports that need to be monitored at the same time to the port list
[0016] Add the destination port that needs to be monitored at the same time to the port list so that the destination port becomes the object of the port list service. A destination port can be added to the port service list at most. When joining, check whether the destination port has been added to the service list of other ports, and whether it exceeds the upper limit of the number of ports allowed in the port list;
[0017] Step 3: According to monitoring needs, set the active status of the destination port in the port list, and adjust the monitoring range flexibly.
[0018] The destination port in the port service list can be set to active (ACTIVE) or inactive (NOT_ACTIVE). The meaning of ACTIVE state is that the port service list needs to monitor and process this destination port message, and the meaning of NOT_ACTIVE is the opposite. By separately setting the active status of each destination port in the port service list, the flexibility of the port list service control and monitoring range is provided.
[0019] When setting the active state, if it is changed from NOT_ACTIVE to ACTIVE, and the current state of the destination port is that there are messages to be received, the port list count semaphore is released once; if it is changed from ACTIVE to NOT_ACTIVE, and the current state of the destination port is If there is a message to be received, the port list count semaphore is recycled once. Count semaphores through the port list to control the number of accesses to the port list;
[0020] Step 4: Use the port list receiving service to monitor and process multiple destination ports at the same time, manage the port list semaphore according to whether the destination port in the port list can receive messages and its status changes, and finally realize the access management of the port list.
[0021] The main processing flow of the port list receiving service, such as figure 1 Shown:
[0022] a) If the port list semaphore is available, it means that there is a destination port on the port list that can receive messages. Obtain the first destination port that can be processed according to the specified rules, and complete the reception of a message. The rules include: always start the search from the first position according to the order of joining, or start the search from the position after the last processed position. After receiving a message, if the destination port still has messages that can continue to be received, the port list semaphore is released once.
[0023] b) If the port list semaphore cannot be obtained, the process in the partition that calls this service will be blocked according to the specified timeout period until a port on the port list becomes available or times out.
[0024] c) When the destination port changes from unavailable to available, if the destination port is in the port list and the active state is ACTIVE, release the port list semaphore where the destination port is located. Note: The detection mechanism that the destination port changes from unavailable to usable is part of the original communication mechanism of the queue port, which does not belong to the scope of this patent.
[0025] d) After the process blocked on the port list is unblocked, the first destination port that can be processed is obtained according to the rules, and the message reception and subsequent processing are completed. Same as step a).
[0026] The following examples illustrate the specific work steps:
[0027] 1) Configure multiple partitions in the configuration tool provided by the operating system. Take three as examples, namely partition A, partition B and partition C;
[0028] 2) The queue ports are allocated to partition A, partition B and partition C respectively. For example, the corresponding relationship of configuration is QPort_B2A_SRC (source port of partition B) --> QPort_B2A_DST (the destination port of partition A), QPort_C2A_SRC (the source port of partition C) --> QPort_C2A_DST (the destination port of partition A);
[0029] 3) In partition A, partition B, and partition C, call the queue port creation service to complete the port creation.
[0030] 4) In partition A, create a port list, and add the destination ports (QPort_B2A_DST, QPort_C2A_DST) that need to be processed to the port list;
[0031] 5) In partition A, set the active state of the destination port in the port list to ACTIVE;
[0032] 6) Periodically send messages through respective queue ports in the processes in partition B and partition C;
[0033] 7) Invoke the port list receiving service in the process of partition A to complete simultaneous monitoring and processing of multiple destination ports;
[0034] 8) The effect achieved by the invention can be achieved by following the above working steps.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Image processing method and device, electronic equipment and storage medium

PendingCN112950462Asave computing resourcesreduce shrink
Owner:BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD

Real-time video stream-oriented edge environment behavior recognition system

PendingCN113591674Asave computing resourcesAchieve lightweight effect
Owner:GUILIN UNIV OF ELECTRONIC TECH

Classification and recommendation of technical efficacy words

  • save computing resources
  • Improve efficiency

Network fault positioning method and device

ActiveCN101783749Asave computing resourcesImprove algorithm accuracy
Owner:BEIJING MATARNET TECH

Map display method, apparatus for controlling map display and navigation apparatus

ActiveCN103185586Asave computing resources
Owner:SHANGHAI PATEO ELECTRONIC EQUIPMENT MANUFACTURING 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