CN1311350C - Method for triggering queue management by sending events in communication queue management - Google Patents

Method for triggering queue management by sending events in communication queue management Download PDF

Info

Publication number
CN1311350C
CN1311350C CNB2004100388278A CN200410038827A CN1311350C CN 1311350 C CN1311350 C CN 1311350C CN B2004100388278 A CNB2004100388278 A CN B2004100388278A CN 200410038827 A CN200410038827 A CN 200410038827A CN 1311350 C CN1311350 C CN 1311350C
Authority
CN
China
Prior art keywords
data
descriptor
pointed
formation
data descriptor
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.)
Expired - Fee Related
Application number
CNB2004100388278A
Other languages
Chinese (zh)
Other versions
CN1690967A (en
Inventor
王伟
张健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2004100388278A priority Critical patent/CN1311350C/en
Publication of CN1690967A publication Critical patent/CN1690967A/en
Application granted granted Critical
Publication of CN1311350C publication Critical patent/CN1311350C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The present invention discloses a method which transmits events to trigger queue management in the communication queue management. The method solves the problem that the system efficiency is affected in the communication queue management process. The present invention has the method that a first pointer is pointed to a data descriptor for sealing transmission data, and a second pointer is pointed to a data descriptor of the sealed data in the transmission queue; the data descriptor pointed by the second pointer is checked before a data transmission control unit transmits data; if the data in the data descriptor is completely transmitted, the data descriptor is released; the data to be transmitted is sealed by the data descriptor pointed by the first pointer, and is merged into the transmission queue; the first pointer and the second pointer are updated, the first pointer is pointed to the next data descriptor for sealing the transmission data, and the second pointer is pointed to a data descriptor of the next sealed data.

Description

In the communication queue management, pass through to send the method for Event triggered queue management
Technical field
The present invention relates to the communication technology, relate in particular to a kind of method of in the communication queue management, passing through to send the Event triggered queue management.
Background technology
At present, the data interaction between most of communication units (communication chip is hereinafter to be referred as CU) and the CPU all can adopt the formation mode to manage.The good and bad handling property that directly influences CPU of queue management.CU has the characteristic of Data Receiving and transmission, so two formations of normal use are carried out data interaction-transmit queue and received formation between CU and the CPU.For CPU, transmit queue refers to the passage of CPU Data transmission to CU, receives formation and then is meant the passage of CU Data transmission to CPU; Transmit queue all is relative with receiving formation, and for CU, transmit queue then is meant the data channel (" transmit queue " hereinafter mentioned is all for CPU) that is delivered to CPU via CU.
When data are transmitted in formation, usually can be encapsulated in the data descriptor (being called for short BD), except comprising data, also can comprise other control information and descriptor (following use BD represents data and control information thereof) among the BD.
BD can be not without foundation generation, after also disappearance that can be not without foundation, so CPU is put into transmit queue with BD, need to wait for that CU handles, only remain after CU finishes processing to BD, CPU could discharge BD, so that reuse in the future.In the prior art, the method that CPU discharges BD has two kinds, down trigger mode and timing inquiry mode.
1, down trigger mode is meant CU after the processing of finishing BD, and CU produces interrupt request and gives CPU, and CPU is not shielding under the situation of this interruption, responds interrupting.By operating system Interrupt Process function or other tasks, finish release then to BD.
Because the down trigger mode needs the interruption of CPU response CU.Yet the process that CPU response is interrupted is surprising to the influence of operating system, comprise analyze interrupt, response is interrupted, interrupt and task between operations such as switching, this portion of time considerably beyond CPU discharge the needed time of BD.Therefore, use the down trigger mode, will have a strong impact on the CPU availability, reduce system performance greatly.
A statistics shows, in VXWORKS (by the embedded real-time operating system of Wind River company design) embedded real-time operating system environment, use the CPU of 750MHz, if that produces 148k interruption in the per second, CPU 16% the time of will using removes to finish the blocked operation between interrupt response and interruption and task.Yet CPU but only need go to finish the release work of 148k BD less than 1% time.
2, inquiry mode regularly is meant that CPU starts timer, when regularly finishing, triggers CPU and removes to inquire about transmit queue, discharges the BD after processed in the transmit queue.Set forth from the software angle, then be meant based on the operating system of CPU operation, starts a software timer, regularly triggering a task removes to inquire about transmit queue, the BD in the release transmit queue after processed.
There is following shortcoming in this method:
(1) if during timing, BD is not in transmit queue, and after so regularly finishing, the operation of CPU inquiry transmit queue then is blank operation, therefore can influence the efficient of system.
(2) regularly inquiry mode is the same with the down trigger mode, and CPU also wants the expensive time go to handle the timer interruption except will discharging the BD in the transmit queue, and operations such as task switching can reduce the performance of system so greatly.
(3) if the precision of timer is not enough, before regularly finishing,, then can cause a large amount of communication datas to lose so if formation is overflowed, lose bigger; If precision of timer is too high, then can cause above-mentioned
(1) and the situation that a large amount of system resource is consumed in (2).
Summary of the invention
The invention provides a kind of method of in the communication queue management, passing through to send the Event triggered queue management, in the communication queue management process, have the problem that influences system effectiveness and performance to solve prior art.
For addressing the above problem, the invention provides following technical scheme:
A kind of method of in the communication queue management, passing through to send the Event triggered queue management, described formation is used to transmit the interaction data between the control module, the The data data descriptor encapsulation in the formation; This method is:
(1) uses first pointed can be used to encapsulate the data descriptor that sends data, use in the second pointed transmit queue data descriptor of encapsulation of data;
(2) whether the data in the data descriptor of transmission control unit for data elder generation's inspection second pointed before sending data send and finish; If then carry out step (3), send otherwise stop this secondary data;
(3) data descriptor of release second pointed uses the data descriptor encapsulation of first pointed to need the data that send and put into transmit queue; And
(4) upgrade first pointer and second pointer, make the first pointed next one can be used to encapsulate the data descriptor that sends data, make the second pointed next one data descriptor of encapsulation of data.
Wherein:
Described formation is the circle queue of regular length or the formation of dynamically changeable length.
The data descriptor of second pointed is the data descriptor that sends data in the data descriptor of encapsulation of data at first.
When the circle queue of regular length is adopted in described formation: can be used to encapsulate the data descriptor that sends data in the first pointed transmit queue; Remain one or more spacings that can be used to encapsulate the data descriptor that sends data between first pointer and the position of second pointer in formation; When the formation initialization, except the data descriptor of first pointed, for other all data descriptors in the formation are filled the transmission data, and these data of setting are sent completely in the data descriptor.
When the formation of dynamically changeable length was adopted in described formation: can be used in the first pointed data descriptor resource pool encapsulate the data descriptor that sends data, after the data to be packaged, data descriptor and data thereof were pressed into data queue; After the data descriptor of second pointed is released, put into described data descriptor resource pool.
Adopt the present invention, control module (as CPU etc.) when sending data, only need get final product by judging whether the data descriptor of encapsulation of data has sent to finish, not only can avoid interrupting extra duty that control module is produced, can also reduce operating system and carry out extra duty and the redundancy overhead of task when switching; Thereby increase substantially the effective rate of utilization of control module, improve the total system performance.
Description of drawings
Figure 1A, Figure 1B synoptic diagram for using transmit queue to communicate by letter between CPU and the CU;
Fig. 2 is the annular transmit queue init state synoptic diagram of regular length;
Fig. 3 is the annular transmit queue running status synoptic diagram of regular length;
Fig. 4 is the view that the annular transmit queue of regular length is about to overflow.
Among the figure, N-expression sends in the data descriptor and does not comprise the transmission data, is in idle condition; Y-expression sends in the data descriptor and comprises the transmission data; The data that Y.F-expression sends in the data descriptor have been finished transmission, can discharge; The data that Y.U-expression sends in the data descriptor are not finished transmission, can not discharge.
Embodiment
Between two control modules, between central processing unit (CPU) and communication unit (CU), when using formation to carry out data interaction, transmitter side is gone into formation with data, and can notify receiver side to carry out Data Receiving immediately and handle.If but the data resource that sends need reclaim release, transmitter side just can carry out data resource and reclaim release after just needs wait pending data to send to finish so.The present invention adopts and sends the Event triggered mode and make transmitter side know that data have sent to finish.
Present embodiment is that example describes with the data interaction between CPU and the CU, and the transmit queue of hereinafter mentioning is meant that data are via the formation passage of CPU to CU.
In the time of will sending data because CPU uses transmit queue and CU to communicate and be pressed into transmit queue, need be in the data descriptor (being called for short TxBD) that transmit queue uses with data encapsulation, therefore in the transmit queue processing procedure, TxBD is a basic processing unit, whether data send finishes, and can obtain feedback from the state of TxBD.
Send the Event triggered mode and be meant that CPU is when sending data at every turn, check and discharge in the transmit queue and sent the TxBD that finishes, for sending the TxBD that finishes, can judge that the status word of TxBD or mode bit are limited by the organization definition of TxBD by status word or the mode bit of TxBD.
When using transmission Event triggered mode to manage transmit queue, require transmit queue to comprise two managing pointers i.e. first pointer and second pointer, first pointer (to call InsertPointer in the following text) is used to mark the TxBD that is currently available for the data transmission; The TxBD that second pointer (to call FreePointer in the following text) is used to mark encapsulation of data and will discharges.When CPU sends data, checking at first whether TxBD that FreePointer points to sends finishes, finish if send, then discharge the TxBD that FreePointer points to, and with the TxBD that FreePointer points to next encapsulation of data and will discharge, the TxBD encapsulation of using InsertPointer to point to then sends data and carries out data and sends.If the TxBD that FreePointer points to still is in user mode, then stop process of transmitting, return the formation flooding information.
Consult shown in Figure 1A, use the transmit queue of variable-length to communicate by letter between CPU and the CU, the similar pipeline of this formation (pipe), CPU use InsertPointer one of taking-up from send the data descriptor resource pool sends data descriptor and encapsulates the data that need transmission, be pressed into transmit queue then, if the data descriptor of this to be first be pressed into transmit queue, the FreePointer of CPU just points to this data descriptor so.CU then uses the pointer CU.pointer of oneself to read up-to-date transmission descriptor from transmit queue and sends.When CPU next time sent data, whether the state that then can judge the data descriptor that FreePointer points to for being sent completely, if be sent completely then this data descriptor is discharged back resource pool.
Consult shown in Figure 1B, use the annular transmit queue of regular length to communicate by letter between CPU and the CU.This formation has comprised several and has sent data descriptor when initialization, and these send data descriptor and contact mutually, form circle queue.The data descriptor that CPU uses InsertPointer to point to encapsulates the data that need transmission, judges whether the data descriptor that FreePointer points to finishes transmission, finishes transmission and then discharges the encapsulation of data that sends in the descriptor.CU then uses the pointer CU.pointer of oneself to read the transmission data descriptor from transmit queue, and is to be sent if the data that encapsulate in the transmission data descriptor are waiting, and then data wherein sent.
As shown in Figure 2, during the transmit queue initialization, all TxBD are idle conditions in the transmit queue, and idle condition also can be considered as sending the state that finishes, and promptly the data among the TxBD have been finished transmission.The TxBD of idle condition just can be used to encapsulation once more and send data.And transmit queue management is used two pointer InsertPointer and FreePointer, the position as shown in Figure 2, the TxBD of FreePointer pointed is the next unit of InsertPointer pointed TxBD.In operational process, FreePointer pointer and InsertPointer pointer remain such relative position relation.
When the initialization transmit queue, need send data and specify the state that sends data descriptor for all the other all TxBD the TxBD that points to except InsertPointer in the formation fill for being sent completely (being that CU need not to send these data).These data are not in order to send, but in order to discharge.Because, under the transmit queue init state,, then need to discharge the TxBD that FreePointer points to if send data, if there are not the data that can discharge among this TxBD, then can produce unusual.The TxBD that InsertPointer points to can not padding data be the state that must be in the free time and discharge because of the TxBD that InsertPointer points to, and this TxBD need be used for filling new data to be sent.
During the initialization transmit queue, on the formation index direction, the FreePointer pointer is in InsertPointer pointer front, and the spacing between two pointers is more than or equal to 1 TxBD unit.And, in process of transmitting, remain fixing spacing between InsertPointer pointer and the FreePoinrter pointer, be idle condition with the TxBD that guarantees the InsertPointer pointed;
Transmit queue is under init state, CPU at first checks the TxBD that FreePointer points to when sending data, judge that this TxBD is in idle condition, be that data among this TxBD have sent and finish, if, CPU then discharges the TxBD that FreePointer points to, content that discharges and process then are to decide according to user's practical application that (content of release and process are not emphasis, because the emphasis that the present invention describes is to trigger release event, concrete releasing operation, perhaps other associative operations are then by application person's decision).After finishing the release of FreePointer sensing TxBD, the FreePointer pointer that need upgrade in time is about to the TxBD that FreePointer points to next encapsulation of data and will discharge.
After successfully having discharged the TxBD of FreePointer pointed, just can carry out this secondary data and send.The TxBD encapsulation data to be sent that CPU just can use InsertPointer to point to are subsequently notified CU to carry out then and are sent, and upgrade InsertPointer and point to the next TxBD that data send that can be used for.
After having carried out the transmission of several times data, the state of each TxBD as shown in Figure 3 in the transmit queue, the data descriptor that CPU judgement FreePointer points to has been finished transmission, then discharge the data that encapsulate in this data descriptor, this data descriptor enters " N " state, and FreePointer moves forward a position.The data descriptor that CPU re-uses the InsertPointer sensing encapsulates the data that need transmission, and this data descriptor has then become state " Y.U " from state " N ", waits for that promptly CU sends, and InsertPointer also moves forward a position.CU finishes transmission read data descriptor to be sent from transmit queue after, the state that sends descriptor is set is " Y.F ", illustrates that these data that send in the descriptor can discharge.
In operational process, can see that FreePointer pointer and InsertPointer pointer remain this relative status, promptly FreePointer pointer and InsertPointer pointer remain synchronous renewal.
This relativeness between FreePointer pointer and the InsertPointer pointer, the TxBD that can guarantee the InsertPointer pointed is in idle condition, can be used to encapsulate the data that will send.Whether CPU need not to judge once more the TxBD state of InsertPointer pointed, only need send to finish by the TxBD that judges the FreePointer pointed to get final product.
When if CPU sends data, check the TxBD of FreePointer pointed, find that the data among this TxBD remain unfulfilled transmission, then expression transmit queue this moment is about to overflow, and can not recharge new transmission data.At this moment, the state of each TxBD is as shown in Figure 4 in the transmit queue.
When transmit queue is in soon overflow status, data among the TxBD of FreePointer pointed also do not send and finish, if therefore at this moment CPU sends data once more, when CPU checks the FreePointer pointer, will return mistake, promptly stop the information that this secondary data sent and returned the transmit queue overflow status.Though this moment, the TxBD of InsertPointer pointed was in idle condition, but in order to guarantee that the TxBD that InsertPointer points to remains idle condition, the TxBD that just can not use InsertPointer to point to this moment encapsulates data to be sent, after must waiting for that CU finishes a data transmission, CPU could send data once more.
Among Fig. 4, the reason that the annular transmit queue is about to overflow is the speed that CPU speed of padding data in transmit queue has substantially exceeded CU reading and sending data from transmit queue, cause and send the data descriptor that points to except InsertPointer in the data queue, other data descriptor has all encapsulated data to be sent, the transmission data descriptor that is other all is in " Y.U " state, comprises the data descriptor that FreePointer points to.If CPU still needs to continue to send data at this moment, when judging the data descriptor state of FreePointer sensing, discovery data are not wherein finished transmission, and transmit queue will overflow, and CPU just need stop to send.
When adopting the formation of dynamically changeable length, the first pointer InsertPointer points to and can be used in the data descriptor resource pool encapsulate the data descriptor that sends data, and after the data to be packaged, data descriptor and data thereof are pressed into data queue.After the data descriptor that the second pointer FreePointer points to is released, put into described data descriptor resource pool.During the formation initialization can without any data descriptor, promptly be set to empty queue.It realizes realizing in like manner with the transmit queue of above-mentioned employing regular length.
The present invention uses the transmission event-triggered, and transmit queue is managed, and not only is confined to discharge the data in the transmit queue, can also be applied to other management of formation, or ASSOCIATE STATISTICS, as the mutual success of data/frequency of failure statistics or the like.
" transmit queue " that the present invention is mentioned and " reception formation " have the general reference implication, and all use formation to carry out in the application of data interaction, all can be by the notion of " transmit queue " and " reception formation ".And " transmit queue " and " reception formation " be one group of notion that can transform mutually, and for example, " the reception formation " of CPU in fact can be considered as " transmit queue " of CU.Therefore, the every occasion that can use " transmit queue " this notion all can be used method of the present invention.

Claims (10)

1, a kind of method of in the communication queue management, passing through to send the Event triggered queue management, described formation is used to transmit the interaction data between the control module, the The data data descriptor encapsulation in the formation; It is characterized in that comprising step:
(1) uses first pointed can be used to encapsulate the data descriptor that sends data, use in the second pointed transmit queue data descriptor of encapsulation of data;
(2) whether the data in the data descriptor of transmission control unit for data elder generation's inspection second pointed before sending data send and finish; If then carry out step (3), send otherwise stop this secondary data;
(3) data descriptor of release second pointed uses the data descriptor encapsulation of first pointed to need the data that send and be pressed into transmit queue; And
(4) upgrade first pointer and second pointer, make the first pointed next one can be used to encapsulate the data descriptor that sends data, make the second pointed next one data descriptor of encapsulation of data.
2, the method for claim 1 is characterized in that, described formation is the circle queue of regular length or the formation of dynamically changeable length.
3, method as claimed in claim 1 or 2 is characterized in that, the data descriptor of second pointed is the data descriptor that sends data in the data descriptor of encapsulation of data at first.
4, method as claimed in claim 3 is characterized in that, when the circle queue of regular length is adopted in described formation, can be used to encapsulate the data descriptor that sends data in the first pointed transmit queue.
5, method as claimed in claim 4, it is characterized in that, when the circle queue of regular length is adopted in described formation, remain one or more spacings that can be used to encapsulate the data descriptor that sends data between first pointer and the position of second pointer in formation.
6, method as claimed in claim 3, it is characterized in that, when the circle queue of regular length is adopted in described formation, when the formation initialization, except the data descriptor of first pointed, for other all data descriptors in the formation are filled the transmission data, and these data of setting are sent completely in data descriptor.
7, method as claimed in claim 3, it is characterized in that, when the formation of dynamically changeable length is adopted in described formation, can be used to encapsulate the data descriptor that sends data in the first pointed data descriptor resource pool, after the data to be packaged, data descriptor and data thereof are pressed into data queue.
8, method as claimed in claim 7 is characterized in that, after the data descriptor of second pointed is released, puts into described data descriptor resource pool.
9, method as claimed in claim 7 is characterized in that, is set to empty queue when the formation initialization of variable-length.
10, the method for claim 1 is characterized in that, in step (2), stops to return the formation flooding information after this secondary data sends and waiting for transmission once more.
CNB2004100388278A 2004-04-30 2004-04-30 Method for triggering queue management by sending events in communication queue management Expired - Fee Related CN1311350C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100388278A CN1311350C (en) 2004-04-30 2004-04-30 Method for triggering queue management by sending events in communication queue management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100388278A CN1311350C (en) 2004-04-30 2004-04-30 Method for triggering queue management by sending events in communication queue management

Publications (2)

Publication Number Publication Date
CN1690967A CN1690967A (en) 2005-11-02
CN1311350C true CN1311350C (en) 2007-04-18

Family

ID=35346427

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100388278A Expired - Fee Related CN1311350C (en) 2004-04-30 2004-04-30 Method for triggering queue management by sending events in communication queue management

Country Status (1)

Country Link
CN (1) CN1311350C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984086B (en) * 2012-11-29 2015-10-28 迈普通信技术股份有限公司 Data transmission method for uplink in data communication and device
CN111147126B (en) * 2019-12-26 2021-11-23 中国人民解放军空军勤务学院 Beidou satellite short message communication data unpacking transmission method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1190512A (en) * 1995-07-06 1998-08-12 艾利森电话股份有限公司 ATM throttling
US6044418A (en) * 1997-06-30 2000-03-28 Sun Microsystems, Inc. Method and apparatus for dynamically resizing queues utilizing programmable partition pointers
US6523060B1 (en) * 1995-04-07 2003-02-18 Cisco Technology, Inc. Method and apparatus for the management of queue pointers by multiple processors in a digital communications network
JP2003152813A (en) * 2001-11-15 2003-05-23 Toshiba Corp Data transmission apparatus
US20030140196A1 (en) * 2002-01-23 2003-07-24 Gilbert Wolrich Enqueue operations for multi-buffer packets

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6523060B1 (en) * 1995-04-07 2003-02-18 Cisco Technology, Inc. Method and apparatus for the management of queue pointers by multiple processors in a digital communications network
CN1190512A (en) * 1995-07-06 1998-08-12 艾利森电话股份有限公司 ATM throttling
US6044418A (en) * 1997-06-30 2000-03-28 Sun Microsystems, Inc. Method and apparatus for dynamically resizing queues utilizing programmable partition pointers
JP2003152813A (en) * 2001-11-15 2003-05-23 Toshiba Corp Data transmission apparatus
US20030140196A1 (en) * 2002-01-23 2003-07-24 Gilbert Wolrich Enqueue operations for multi-buffer packets

Also Published As

Publication number Publication date
CN1690967A (en) 2005-11-02

Similar Documents

Publication Publication Date Title
CN101281458B (en) Apparatus, system and method for recycling rubbish
EP2552081B1 (en) Interrupt management
Buzzard et al. An implementation of the Hamlyn sender-managed interface architecture
CN1312577C (en) Method for realizing communication process zero copy information queue
CN1159657C (en) Bus system and its data transmitting method
CN1317640C (en) Multi-task application software module management method in real-time operating system environment
CN1967486A (en) Method and system for accelerating process in a processing environment
CN1311350C (en) Method for triggering queue management by sending events in communication queue management
CN1925453A (en) Message transferring method and device
CN1659834A (en) Flow control management to extend the performance range of fibre channel link
CN101035130A (en) Browser/server structure based information distribution method and system
CN1845084A (en) Embedded remote monitoring system based on Ethernet and PSTN communication mode
CN1788261A (en) Usb host controller with memory for transfer descriptors
CN1248465C (en) Management method of data fransmission/receiving butter region in network communication
CN1908925A (en) Method for improving PCI communication credibility and efficiency
CN1955890A (en) Method for raising communication speed of HID equipment
CN1411217A (en) Method of raising IP message forwarding speed utilizing slow storage technology
CN1300661C (en) Computer system and power source management state
CN1203427C (en) Load balance modulator possessing TCP connection fault tolerant function and its modulating method
CN1266883C (en) Method for controlling network port flow
CN1705295A (en) Packet transmission system having priority and method therefor
CN1901492A (en) Communication method via bus interface in network and and system thereof
CN1304951C (en) Internal memory protective method for digital signal processing telecommunicating applied system
CN101061660A (en) Ensured delivery of control messages by retransmission if a data entity of a certain type is not received within a time period
CN101702713A (en) Method and device for increasing UDP transmission efficiency

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070418

Termination date: 20150430

EXPY Termination of patent right or utility model