CN108011704A - Half-duplex communications device and its communication means, the device of half-duplex operation - Google Patents
Half-duplex communications device and its communication means, the device of half-duplex operation Download PDFInfo
- Publication number
- CN108011704A CN108011704A CN201610942172.XA CN201610942172A CN108011704A CN 108011704 A CN108011704 A CN 108011704A CN 201610942172 A CN201610942172 A CN 201610942172A CN 108011704 A CN108011704 A CN 108011704A
- Authority
- CN
- China
- Prior art keywords
- port
- space
- memory block
- storage
- storage area
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L5/00—Arrangements affording multiple use of the transmission path
- H04L5/14—Two-way operation using the same type of signal, i.e. duplex
- H04L5/16—Half-duplex systems; Simplex/duplex switching; Transmission of break signals non-automatically inverting the direction of transmission
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Bidirectional Digital Transmission (AREA)
Abstract
半双工通信装置及其通信方法、半双工通信的装置,所述半双工通信装置包括:第一端口;第二端口;分别与所述第一端口和第二端口相应的发送装置和接收装置;以及一共享存储空间,所述共享存储空间包括:适于存储第一端口所接收数据的第一存储区,和适于存储第二端口所接收数据的第二存储区;控制器,适于基于预设时长内第一端口接收的数据量和第二端口接收的数据量的信息,对所述第一存储区和第二存储区所占空间进行调整。上述的方案,可以提高半双工通信装置的存储空间的利用率。
A half-duplex communication device and its communication method, and a device for half-duplex communication, the half-duplex communication device includes: a first port; a second port; a sending device corresponding to the first port and the second port; a receiving device; and a shared storage space, the shared storage space comprising: a first storage area suitable for storing data received by the first port, and a second storage area suitable for storing data received by the second port; a controller, It is adapted to adjust the space occupied by the first storage area and the second storage area based on the information of the amount of data received by the first port and the amount of data received by the second port within a preset period of time. The above solution can improve the utilization rate of the storage space of the half-duplex communication device.
Description
技术领域technical field
本发明涉及集成电路技术领域,特别是涉及一种半双工通信装置及其通信方法、半双工通信的装置。The invention relates to the technical field of integrated circuits, in particular to a half-duplex communication device, a communication method thereof, and a half-duplex communication device.
背景技术Background technique
半双工通信(Half-duplex Communication),可以实现双向的通信,但不能在两个方向上同时进行通信,必须轮流交替地进行。也就是说,通信信道的每一端都可以是发送端,也可以是接收端。但同一时刻里,信息只能存在一个传输方向。例如,有步话机通信、对讲机通信等。Half-duplex communication (Half-duplex Communication) can realize two-way communication, but it cannot communicate in two directions at the same time, and must be carried out alternately. That is, each end of the communication channel can be either a transmitting end or a receiving end. But at the same time, information can only exist in one transmission direction. For example, there are walkie-talkie communication, walkie-talkie communication, and the like.
传统的半双工通信装置包括以太网端口和电话端口,以及与以太网端口和电话端口分别对应设置的发送端、发送端存储接口、接收端、接收端存储接口和存储器。在进行数据传输时,以太网端口对应的接收端接收的数据,通过对应的接收端存储接口传输至对应的存储器中进行存储,再通过电话端口的接收端存储接口将以太网端口对应的存储器中存储的数据传输给电话端口的发送端,最后由电话端口的发送端传输给其他设备。同理,电话端口对应的接收端接收的数据,通过对应的接收端存储接口传输至对应的存储器中进行存储,再通过以太网端口的接收端存储接口将电话端口对应的存储器中存储的数据传输给以太网端口的发送端,最后由以太网端口的发送端传输给其他设备。A traditional half-duplex communication device includes an Ethernet port and a telephone port, and a sending end, a sending end storage interface, a receiving end, a receiving end storage interface and a memory respectively set corresponding to the Ethernet port and the telephone port. During data transmission, the data received by the receiving end corresponding to the Ethernet port is transmitted to the corresponding memory through the corresponding receiving end storage interface for storage, and then stored in the memory corresponding to the Ethernet port through the receiving end storage interface of the telephone port. The stored data is transmitted to the sending end of the phone port, and finally transmitted to other devices by the sending end of the phone port. Similarly, the data received by the receiving end corresponding to the telephone port is transmitted to the corresponding memory for storage through the corresponding receiving end storage interface, and then the data stored in the memory corresponding to the telephone port is transmitted through the receiving end storage interface of the Ethernet port To the sending end of the Ethernet port, and finally transmitted to other devices by the sending end of the Ethernet port.
但是,现有的半双工通信装置,存在着存储空间利用率低的问题。However, the existing half-duplex communication device has the problem of low storage space utilization.
发明内容Contents of the invention
本发明实施例要解决的技术问题是如何提高半双工通信装置的存储空间的利用率。The technical problem to be solved by the embodiments of the present invention is how to improve the utilization rate of the storage space of the half-duplex communication device.
为了解决上述问题,本发明实施例提供了一种半双工通信装置,所述半双工通信装置包括:第一端口;第二端口;分别与所述第一端口和第二端口相应的发送装置和接收装置;以及一共享存储空间,所述共享存储空间包括:适于存储第一端口所接收数据的第一存储区,以及适于存储第二端口所接收数据的第二存储区;控制器,适于基于预设时长内第一端口接收的数据量和第二端口接收的数据量的信息,对所述第一存储区和第二存储区所占空间进行调整。In order to solve the above problems, an embodiment of the present invention provides a half-duplex communication device, the half-duplex communication device includes: a first port; a second port; sending ports respectively corresponding to the first port and the second port device and receiving device; and a shared storage space, the shared storage space includes: a first storage area suitable for storing data received by the first port, and a second storage area suitable for storing data received by the second port; control The device is adapted to adjust the space occupied by the first storage area and the second storage area based on the information of the amount of data received by the first port and the amount of data received by the second port within a preset period of time.
可选地,所述发送装置和接收装置分别为发射机和接收机。Optionally, the sending device and the receiving device are respectively a transmitter and a receiver.
本发明实施例还提供了一种半双工通信装置的通信方法,所述方法包括:获取预设时长内第一端口和第二端口接收的数据量的信息;基于预设时长内第一端口和第二端口接收的数据量的信息,对预设的共享存储空间中第一存储区和第二存储区所占空间进行调整;所述第一存储区适于存储第一端口所接收的数据,所述第二存储区适于存储第二端口所接收的数据。An embodiment of the present invention also provides a communication method for a half-duplex communication device, the method comprising: obtaining information on the amount of data received by the first port and the second port within a preset time period; and the information of the amount of data received by the second port, adjust the space occupied by the first storage area and the second storage area in the preset shared storage space; the first storage area is suitable for storing the data received by the first port , the second storage area is suitable for storing data received by the second port.
可选地,所述基于预设时长内第一端口和第二端口接收的数据量的信息,对预设的共享存储空间中第一存储区和第二存储区所占空间进行调整,包括:将预设时长内第一端口和第二端口接收的数据量的比例,分别作为第一存储区和所述第二存储区在所述共享存储空间中所占空间的比例;通过控制预设的空间分配指针指向所述共享存储空间对应的存储地址,将所述共享存储空间中相应比例的存储区域,分别分配给所述第一存储区和第二存储区。Optionally, adjusting the space occupied by the first storage area and the second storage area in the preset shared storage space based on the information of the amount of data received by the first port and the second port within a preset time period includes: The ratio of the amount of data received by the first port and the second port within the preset time period is used as the ratio of the space occupied by the first storage area and the second storage area in the shared storage space; by controlling the preset The space allocation pointer points to a storage address corresponding to the shared storage space, and allocates corresponding proportions of storage areas in the shared storage space to the first storage area and the second storage area, respectively.
可选地,所述预设时长为半双工通信装置的通信周期。Optionally, the preset duration is a communication period of a half-duplex communication device.
可选地,在所述半双工通信装置初始化阶段,所述第一存储区和第二存储区各占所述共享存储空间中的一半区域。Optionally, during the initialization phase of the half-duplex communication device, the first storage area and the second storage area each occupy half of the shared storage space.
可选地,所述第一端口为以太网端口,所述第二端口为电话端口。Optionally, the first port is an Ethernet port, and the second port is a telephone port.
本发明实施例还提供了一种半双工通信的通信装置,所述装置包括:获取单元,适于获取预设时长内第一端口和第二端口接收的数据量的信息;调整单元,适于基于预设时长内第一端口和第二端口接收的数据量的信息,对预设的共享存储空间中第一存储区和第二存储区所占空间进行调整,所述第一存储区适于存储第一端口所接收的数据,所述第二存储区适于存储第二端口所接收的数据。The embodiment of the present invention also provides a communication device for half-duplex communication. The device includes: an acquisition unit adapted to acquire information on the amount of data received by the first port and the second port within a preset time period; an adjustment unit adapted to Based on the information of the amount of data received by the first port and the second port within a preset period of time, the space occupied by the first storage area and the second storage area in the preset shared storage space is adjusted, and the first storage area is suitable for For storing data received by the first port, the second storage area is suitable for storing data received by the second port.
可选地,所述获取单元,适于分别通过所述第一端口和第二端口对应的发送装置存储接口和接收装置存储接口,获取预设时长内第一端口和第二端口接收的数据量的信息。Optionally, the obtaining unit is adapted to obtain the amount of data received by the first port and the second port within a preset time period through the storage interface of the sending device and the storage interface of the receiving device corresponding to the first port and the second port respectively Information.
可选地,所述调整单元,适于将预设时长内第一端口和第二端口接收的数据量的比例,分别作为第一存储区和所述第二存储区在所述共享存储空间中所占空间的比例;通过控制预设的空间分配指针指向所述共享存储空间对应的存储地址,将所述共享存储空间中相应比例的存储区域,分别分配给所述第一存储区和第二存储区。Optionally, the adjustment unit is adapted to use the ratio of the amount of data received by the first port and the second port within a preset period of time as the first storage area and the second storage area in the shared storage space The proportion of the occupied space; by controlling the preset space allocation pointer to point to the storage address corresponding to the shared storage space, the corresponding proportion of the storage area in the shared storage space is allocated to the first storage area and the second storage area respectively. storage area.
可选地,所述预设时长为半双工通信装置的通信周期。Optionally, the preset duration is a communication period of a half-duplex communication device.
可选地,在所述半双工通信装置初始化阶段,所述第一存储区和第二存储区各占所述共享存储空间中的一半区域。Optionally, during the initialization phase of the half-duplex communication device, the first storage area and the second storage area each occupy half of the shared storage space.
可选地,所述第一端口为以太网端口,所述第二端口为电话端口。Optionally, the first port is an Ethernet port, and the second port is a telephone port.
可选地,所述半双工通信的通信装置为控制器。Optionally, the communication device for half-duplex communication is a controller.
与现有技术相比,本发明的技术方案具有以下有益效果:Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
上述的方案,通过半双工通信装置的第一端口与和所述第二端口在预设的时长内接收的数据量的信息,动态地调整预设的共享存储空间在第一存储区和第二存储区之间的分配比例,以分别存储所述第一端口和第二端口接收的数据,而非为第一端口和第二端口设定固定大小的存储空间,故可以节省存储空间,并提高存储空间的利用率。In the above solution, the first port of the half-duplex communication device and the information of the amount of data received by the second port within a preset time period dynamically adjust the preset shared storage space between the first storage area and the second port. The distribution ratio between the two storage areas is to store the data received by the first port and the second port respectively, instead of setting a fixed size storage space for the first port and the second port, so the storage space can be saved, and Improve storage space utilization.
附图说明Description of drawings
图1是本发明实施例中的一种半双工通信装置的结构示意图;FIG. 1 is a schematic structural diagram of a half-duplex communication device in an embodiment of the present invention;
图2是本发明实施例中的另一种半双工通信装置的结构示意图;FIG. 2 is a schematic structural diagram of another half-duplex communication device in an embodiment of the present invention;
图3是本发明实施例中的一种半双工通信的通信方法的流程示意图;FIG. 3 is a schematic flowchart of a half-duplex communication communication method in an embodiment of the present invention;
图4本发明实施例中的半双工通信的通信装置的结构示意图。FIG. 4 is a schematic structural diagram of a communication device for half-duplex communication in an embodiment of the present invention.
具体实施方式Detailed ways
如背景技术所言,现有的半双工通信装置需要较大的存储容量,分别对以太网端口和电话端口对应的接收装置接收的数据进行存储,存在着存储空间利用率低的问题。As mentioned in the background art, the existing half-duplex communication device requires relatively large storage capacity, and stores the data received by the receiving device corresponding to the Ethernet port and the telephone port separately, which has the problem of low storage space utilization.
为解决上述问题,本发明实施例的技术方案通过半双工通信装置的第一端口与和第二端口在预设的时长内接收的数据量的信息,动态地调整预设的共享存储空间中第一存储区和第二存储区所占空间,可以节省存储空间,并提高存储空间的利用率。In order to solve the above problems, the technical solution of the embodiment of the present invention dynamically adjusts the preset shared storage space through the information of the amount of data received by the first port and the second port of the half-duplex communication device within a preset duration. The space occupied by the first storage area and the second storage area can save storage space and improve the utilization rate of storage space.
为使本发明的上述目的、特征和有益效果能够更为明显易懂,下面结合附图对本发明的具体实施例做详细的说明。In order to make the above objects, features and beneficial effects of the present invention more comprehensible, specific embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings.
图1示出了本发明实施例中的一种半双工通信装置的结构。参见图1,本发明实施例中的半双工通信装置可以包括:第一端口101,分别与第一端口101耦接的第一发送装置103和第一接收装置104;第二端口102,分别与第二端口102耦接的第二发送装置105和第二接收装置106;第一发送装置103、第一接收装置104、第二发送装置105和第二接收装置106还分别与共享存储空间107耦接,共享存储空间107还与控制器108耦接。FIG. 1 shows the structure of a half-duplex communication device in an embodiment of the present invention. 1, the half-duplex communication device in the embodiment of the present invention may include: a first port 101, a first sending device 103 and a first receiving device 104 coupled to the first port 101 respectively; a second port 102, respectively The second sending device 105 and the second receiving device 106 coupled with the second port 102; The shared storage space 107 is also coupled to the controller 108 .
共享存储空间107包括第一存储区和第二存储区。其中,第一存储区适于存储第一端口所接收数据,第二存储区适于存储第二端口所接收数据.The shared storage space 107 includes a first storage area and a second storage area. Among them, the first storage area is suitable for storing the data received by the first port, and the second storage area is suitable for storing the data received by the second port.
控制器108,适于基于预设时长内第一端口101接收的数据量和第二端口102接收的数据量的信息,对所述第一存储区和第二存储区在共享存储空间中所占空间进行调整。The controller 108 is adapted to, based on the information of the amount of data received by the first port 101 and the amount of data received by the second port 102 within a preset period of time, determine the share of the first storage area and the second storage area in the shared storage space space to adjust.
上述的方案,通过半双工通信装置的第一端口与和所述第二端口在预设的时长内接收的数据量的信息,动态地调整预设的共享存储空间在第一存储区和第二存储区之间的分配比例,以分别存储所述第一端口和第二端口接收的数据,而非为第一端口和第二端口设定固定大小的存储空间,故可以节省存储空间,并提高存储空间的利用率。In the above solution, the first port of the half-duplex communication device and the information of the amount of data received by the second port within a preset time period dynamically adjust the preset shared storage space between the first storage area and the second port. The distribution ratio between the two storage areas is to store the data received by the first port and the second port respectively, instead of setting a fixed size storage space for the first port and the second port, so the storage space can be saved, and Improve storage space utilization.
下面将以第一端口为以太网端口,第二端口为电话端口对本发明实施例中的半双工通信装置做进一步详细的介绍。In the following, the half-duplex communication device in the embodiment of the present invention will be further described in detail with the first port being an Ethernet port and the second port being a telephone port.
图2示出了本发明实施例中的一种半双工通信装置的结构。参见图2,本发明实施例中的半双工通信装置可以包括以太网端口201、电话端口202、以太网发射机203、以太网接收机204、以太网发射机存储接口205、以太网接收机存储接口206、电话发射机207、电话接收装置208、电话发射机存储接口209、电话接收机存储接口210、控制器211和共享存储空间212。FIG. 2 shows the structure of a half-duplex communication device in an embodiment of the present invention. Referring to Fig. 2, the half-duplex communication device in the embodiment of the present invention can comprise Ethernet port 201, telephone port 202, Ethernet transmitter 203, Ethernet receiver 204, Ethernet transmitter storage interface 205, Ethernet receiver Storage interface 206 , telephone transmitter 207 , telephone receiving device 208 , telephone transmitter storage interface 209 , telephone receiver storage interface 210 , controller 211 and shared storage space 212 .
其中,以太网端口101分别与以太网发射机203和以太网接收机204耦接,以太网发射机203还通过以太网发射机存储接口205与共享存储空间212耦接,以太网接收机204还通过以太网接收机存储接口206与共享存储空间212耦接。Wherein, the Ethernet port 101 is coupled with the Ethernet transmitter 203 and the Ethernet receiver 204 respectively, the Ethernet transmitter 203 is also coupled with the shared storage space 212 through the Ethernet transmitter storage interface 205, and the Ethernet receiver 204 is also coupled The shared storage space 212 is coupled through the Ethernet receiver storage interface 206 .
电话端口202分别与电话发射机207和电话接收机208耦接,电话发射机207还通过电话发射机存储接口209与共享存储空间212耦接,电话接收机208还通过电话接收机存储接口210与共享存储空间212耦接。The telephone port 202 is coupled with the telephone transmitter 207 and the telephone receiver 208 respectively, the telephone transmitter 207 is also coupled with the shared storage space 212 through the telephone transmitter storage interface 209, and the telephone receiver 208 is also coupled with the telephone receiver storage interface 210 and A shared memory space 212 is coupled.
控制器211与共享存储空间212耦接,并同时与以太网发射机存储接口205、以太网接收机存储接口206、电话发射机存储接口209和电话接收机存储接口210耦接。The controller 211 is coupled to the shared storage space 212 and is also coupled to the Ethernet transmitter storage interface 205 , the Ethernet receiver storage interface 206 , the telephone transmitter storage interface 209 and the telephone receiver storage interface 210 .
在具体实施中,本发明实施例中的半双工通信装置通过控制器211将预设的共享存储空间212中用于存储第一端口接收的数据的第一存储区和用于存储第二端口接收的数据的第二存储区所占空间进行动态分配,以提高存储空间的利用率,具体请参见图3。In a specific implementation, the half-duplex communication device in the embodiment of the present invention uses the controller 211 to use the preset shared storage space 212 for storing the first storage area for data received by the first port and for storing the data received by the second port The space occupied by the second storage area of the received data is dynamically allocated to improve the utilization rate of the storage space. Please refer to FIG. 3 for details.
图3示出了本发明实施例中的一种半双工通信装置的通信方法的流程图。参见图3,本发明实施例中的半双工通信装置的通信方法,适于在半双工通信过程中,对共享存储空间中第一存储区和第二存储器所占空间进行调整,具体可以采用如下的步骤实现:Fig. 3 shows a flowchart of a communication method of a half-duplex communication device in an embodiment of the present invention. Referring to FIG. 3 , the communication method of the half-duplex communication device in the embodiment of the present invention is suitable for adjusting the space occupied by the first storage area and the second memory in the shared storage space during the half-duplex communication process. Specifically, it can be Take the following steps to achieve:
步骤S301:获取预设时长内第一端口和第二端口接收的数据量的信息。Step S301: Obtain information about the amount of data received by the first port and the second port within a preset time period.
参见图2,在具体实施中,控制器211分别与共享存储空间212,以及以太网发射机存储接口205、以太网接收机存储接口206、电话发送存储接口209和电话接收存储接口210耦接。Referring to FIG. 2 , in a specific implementation, the controller 211 is coupled to the shared storage space 212 , and the Ethernet transmitter storage interface 205 , the Ethernet receiver storage interface 206 , the telephone transmission storage interface 209 and the telephone reception storage interface 210 .
其中,以太网发射机存储接口205和以太网接收机存储接口206分别用于产生第一存储区的读地址和写地址,电话发送存储接口209和电话接收存储接口120分别用于产生第二存储区的读地址和写地址。当达到预设时长时,控制器211可以通过以太网发射机存储接口205和以太网接收机存储接口206产生的第一存储区的读地址和写地址,确定第一存储区中所存储的数据的数量,并通过电话发送存储接口209和电话接收存储接口210产生的第二存储区的读地址和写地址,确定第二存储区中所存储的数据的数量。Wherein, the Ethernet transmitter storage interface 205 and the Ethernet receiver storage interface 206 are respectively used to generate the read address and the write address of the first storage area, and the telephone transmission storage interface 209 and the telephone reception storage interface 120 are respectively used to generate the second storage area. The read address and write address of the area. When the preset duration is reached, the controller 211 can determine the data stored in the first storage area through the read address and write address of the first storage area generated by the Ethernet transmitter storage interface 205 and the Ethernet receiver storage interface 206 The amount of data stored in the second storage area is determined by sending the read address and the write address of the second storage area generated by the phone sending storage interface 209 and the phone receiving storage interface 210.
在本发明一实施中,所述预设时长为半双工通信装置的一个通信周期,包括以太网接收数据、电话端口发送数据的周期,加上电话端口接收数据、以太网端口发送数据的周期。在所述通信周期中,在以太网端口接收数据的周期内,通过以太网端口接收的数据会接着由电话端口传输出去。同样,在电话端口接收数据的周期内,通过电话端口接收的数据,接着由以太网端口向外传输。因此,可以将预设时长内的第一存储区和第二存储区中存储的数据量分别作为预设时长内第一端口和第二端口所接收的数据量的衡量。In an implementation of the present invention, the preset duration is a communication cycle of the half-duplex communication device, including the cycle of receiving data by the Ethernet and sending data by the telephone port, plus the cycle of receiving data by the phone port and sending data by the Ethernet port . In the communication period, during the period when the Ethernet port receives data, the data received through the Ethernet port will then be transmitted out through the telephone port. Likewise, during the period when the phone port is receiving data, the data received through the phone port is then transmitted out from the Ethernet port. Therefore, the amount of data stored in the first storage area and the second storage area within the preset time period can be used as a measure of the amount of data received by the first port and the second port within the preset time length.
步骤S302:基于预设时长内第一端口和第二端口接收的数据量的信息,对预设的共享存储空间中第一存储区和第二存储区所占空间进行调整。Step S302: Based on the information of the amount of data received by the first port and the second port within a preset time period, adjust the space occupied by the first storage area and the second storage area in the preset shared storage space.
在具体实施中,控制器211在确定预设时长内第一存储区和第二存储区中存储的数据量信息时,根据第一存储区和第二存储区接收的数据量的信息,对共享存储空间212中第一存储区和第二存储区所占空间进行调整。In a specific implementation, when the controller 211 determines the amount of data stored in the first storage area and the second storage area within a preset time period, according to the information on the amount of data received by the first storage area and the second storage area, the shared The space occupied by the first storage area and the second storage area in the storage space 212 is adjusted.
具体而言,控制器211可以通过将对应的预设时长内第一存储区和第二存储区中存储数据的数量进行比较,并根据比较结果,为存储数据量较大的存储区分配较多的存储空间,将预设存储空间中剩余的存储空间分配给存储数据量较小的存储区。在本发明一实施例中,控制器211根据预设时长内第一存储区和第二存储区中存储数据的数量的比例,将预设存储空间中相应比例的存储空间分配给对应的存储区。Specifically, the controller 211 can compare the amount of data stored in the first storage area and the second storage area within the corresponding preset time period, and according to the comparison result, allocate more storage space, allocate the remaining storage space in the preset storage space to the storage area with a small amount of data stored. In an embodiment of the present invention, the controller 211 allocates a corresponding proportion of the storage space in the preset storage space to the corresponding storage area according to the ratio of the amount of data stored in the first storage area and the second storage area within the preset time length .
在具体实施中,控制器211可以通过控制空间分配指针指向共享存储空间中的位置进行调整,以调整第一存储区和第二存储区在共享存储空间212中所占空间。其中,第一存储区对应的空间分配指针指向共享存储空间中第一存储区的起始地址,第二存储区对应的空间分配指针指向共享存储空间中第二存储区的起始地址。In a specific implementation, the controller 211 can adjust the space occupied by the first storage area and the second storage area in the shared storage space 212 by controlling the space allocation pointer to point to a position in the shared storage space. Wherein, the space allocation pointer corresponding to the first storage area points to the start address of the first storage area in the shared storage space, and the space allocation pointer corresponding to the second storage area points to the start address of the second storage area in the shared storage space.
在半双工通信装置的初始化阶段,第一存储区和第二存储区分别占用共享存储空间的一般存储空间,此时,第一存储区对应的空间分配指针指向共享存储空间的零地址,第二存储区对应的空间分配指针指向共享存储空间的(k/2-1)地址。其中,k表示共享存储空间的存储容量。In the initialization stage of the half-duplex communication device, the first storage area and the second storage area respectively occupy the general storage space of the shared storage space. At this time, the space allocation pointer corresponding to the first storage area points to the zero address of the shared storage space. The space allocation pointer corresponding to the second storage area points to the (k/2-1) address of the shared storage space. Wherein, k represents the storage capacity of the shared storage space.
例如,当共享存储空间具有1Kb的存储容量时,在半双工通信装置的初始化阶段,第一存储区和第一存储区分别具有512比特的存储空间。此时,第一存储区对应的分配指针指向共享存储空间的零地址区域,第二存储区对应的空间分配指针指向共享存储空间的512地址,也即0~511地址对应的存储空间作为第一存储区,511~2023地址对应的存储空间作为第一存储区。For example, when the shared storage space has a storage capacity of 1Kb, the first storage area and the first storage area each have a storage space of 512 bits during the initialization phase of the half-duplex communication device. At this time, the allocation pointer corresponding to the first storage area points to the zero address area of the shared storage space, and the space allocation pointer corresponding to the second storage area points to the 512 address of the shared storage space, that is, the storage space corresponding to addresses 0-511 is used as the first In the storage area, the storage space corresponding to addresses 511-2023 is used as the first storage area.
在半双工通信装置的工作过程中,控制器以预设时长为周期对第一存储区和第二存储区中存储的数据量进行比较,并根据比较结果通过移动第二存储区对应的空间分配指针指向的存储位置,从而将共享存储空间中较多的存储空间分配给存储数据量较大的第一存储区或者第二存储区。During the working process of the half-duplex communication device, the controller compares the amount of data stored in the first storage area and the second storage area with a preset period of time, and moves the space corresponding to the second storage area according to the comparison result. The storage location pointed to by the pointer is allocated, so that more storage space in the shared storage space is allocated to the first storage area or the second storage area that stores a large amount of data.
这里需要指出的是,当第一存储区或第二存储区在预设时长内存储的数据为零时,共享存储空间的全部存储空间将全部分配给存储有数据的存储区。It should be pointed out here that when the data stored in the first storage area or the second storage area is zero within the preset time period, all the storage space of the shared storage space will be allocated to the storage area storing the data.
上述对本发明实施例中的半双工通信的通信方法进行了详细的介绍,下面将对上述的方法对应的装置进行描述。The communication method for half-duplex communication in the embodiment of the present invention has been described in detail above, and the device corresponding to the above method will be described below.
图4示出了本发明实施例中的一种半双工通信的通信装置的结构。参见图4,本发明实施例中的一种半双工通信的通信装置400可以包括获取单元401和调整单元402,其中:FIG. 4 shows the structure of a communication device for half-duplex communication in an embodiment of the present invention. Referring to FIG. 4 , a communication device 400 for half-duplex communication in an embodiment of the present invention may include an acquisition unit 401 and an adjustment unit 402, wherein:
所述获取单元401,适于获取预设时长内第一端口和第二端口接收的数据量的信息。The obtaining unit 401 is adapted to obtain information about the amount of data received by the first port and the second port within a preset time period.
所述调整单元402,适于基于预设时长内第一端口和第二端口接收的数据量的信息,对预设的共享存储空间中第一存储区和第二存储区所占空间进行调整,所述第一存储区适于存储第一端口所接收的数据,所述第二存储区适于存储第二端口所接收的数据。The adjustment unit 402 is adapted to adjust the space occupied by the first storage area and the second storage area in the preset shared storage space based on the information of the amount of data received by the first port and the second port within a preset time period, The first storage area is suitable for storing data received by the first port, and the second storage area is suitable for storing data received by the second port.
在本发明一实施例中,所述获取单元401,适于分别通过所述第一端口和第二端口对应的发送装置存储接口和接收装置存储接口,获取预设时长内第一端口和第二端口接收的数据量的信息。In an embodiment of the present invention, the obtaining unit 401 is adapted to obtain the first port and the second port within a preset time period through the storage interface of the sending device and the storage interface of the receiving device corresponding to the first port and the second port respectively. Information about the amount of data received by the port.
在本发明一实施例中,所述调整单元402,适于将预设时长内第一端口和第二端口接收的数据量的比例,分别作为第一存储区和所述第二存储区在所述共享存储空间中所占空间的比例;通过控制预设的空间分配指针指向所述共享存储空间对应的存储地址,将所述共享存储空间中相应比例的存储区域,分别分配给所述第一存储区和第二存储区。In an embodiment of the present invention, the adjustment unit 402 is adapted to use the ratio of the amount of data received by the first port and the second port within a preset time period as the ratio of the first storage area and the second storage area in the first storage area and the second storage area respectively. The proportion of space occupied in the shared storage space; by controlling the preset space allocation pointer to point to the storage address corresponding to the shared storage space, the corresponding proportion of storage areas in the shared storage space are allocated to the first storage area and a second storage area.
在本发明一实施例中,所述预设时长可以根据实际的需要进行设置,如设置为半双工通信装置的通信周期。In an embodiment of the present invention, the preset duration can be set according to actual needs, for example, set as a communication period of a half-duplex communication device.
在本发明一实施例中,在所述半双工通信装置初始化阶段,所述第一存储区和第二存储区各占所述共享存储空间中的一半区域。In an embodiment of the present invention, during the initialization phase of the half-duplex communication device, the first storage area and the second storage area each occupy half of the shared storage space.
在本发明一实施例中,所述第一端口为以太网端口,所述第二端口为电话端口。In an embodiment of the present invention, the first port is an Ethernet port, and the second port is a telephone port.
在本发明一实施例中,所述半双工通信的通信装置为控制器。In an embodiment of the present invention, the communication device for half-duplex communication is a controller.
采用本发明实施例中的上述方案,可以动态地调整第一存储区和第二存储区在预设的共享存储空间中所占用的空间,以分别存储所述第一端口和第二端口接收的数据,而不是为第一端口和第二端口分别设定对应的固定大小的存储空间,因而可以节省存储空间,并提高存储空间的利用率。By adopting the above solution in the embodiment of the present invention, the space occupied by the first storage area and the second storage area in the preset shared storage space can be dynamically adjusted to store the data received by the first port and the second port respectively. data, instead of setting corresponding fixed-sized storage spaces for the first port and the second port respectively, so that storage space can be saved and the utilization rate of the storage space can be improved.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:ROM、RAM、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: ROM, RAM, disk or CD, etc.
虽然本发明披露如上,但本发明并非限定于此。任何本领域技术人员,在不脱离本发明的精神和范围内,均可作各种更动与修改,因此本发明的保护范围应当以权利要求所限定的范围为准。Although the present invention is disclosed above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, so the protection scope of the present invention should be based on the scope defined in the claims.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610942172.XA CN108011704B (en) | 2016-11-01 | 2016-11-01 | Half-duplex communication device, communication method thereof and half-duplex communication device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610942172.XA CN108011704B (en) | 2016-11-01 | 2016-11-01 | Half-duplex communication device, communication method thereof and half-duplex communication device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108011704A true CN108011704A (en) | 2018-05-08 |
CN108011704B CN108011704B (en) | 2020-10-09 |
Family
ID=62047268
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610942172.XA Active CN108011704B (en) | 2016-11-01 | 2016-11-01 | Half-duplex communication device, communication method thereof and half-duplex communication device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108011704B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112737977A (en) * | 2020-12-28 | 2021-04-30 | 苏州浪潮智能科技有限公司 | Data packet processing method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101593165A (en) * | 2009-04-09 | 2009-12-02 | 上海微电子装备有限公司 | Duplex communication method based on double-port RAM |
CN101996147A (en) * | 2009-08-25 | 2011-03-30 | 北京广利核系统工程有限公司 | Method for realizing dual-port RAM (Random-Access memory) mutual exclusion access |
CN102377682A (en) * | 2011-12-12 | 2012-03-14 | 西安电子科技大学 | Queue management method and device based on variable-length packets stored in fixed-size location |
US8677065B1 (en) * | 2004-05-13 | 2014-03-18 | Robert E. Cousins | Transaction-based storage system and method that uses variable sized objects to store data |
-
2016
- 2016-11-01 CN CN201610942172.XA patent/CN108011704B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8677065B1 (en) * | 2004-05-13 | 2014-03-18 | Robert E. Cousins | Transaction-based storage system and method that uses variable sized objects to store data |
CN101593165A (en) * | 2009-04-09 | 2009-12-02 | 上海微电子装备有限公司 | Duplex communication method based on double-port RAM |
CN101996147A (en) * | 2009-08-25 | 2011-03-30 | 北京广利核系统工程有限公司 | Method for realizing dual-port RAM (Random-Access memory) mutual exclusion access |
CN102377682A (en) * | 2011-12-12 | 2012-03-14 | 西安电子科技大学 | Queue management method and device based on variable-length packets stored in fixed-size location |
Non-Patent Citations (2)
Title |
---|
SUNGWOOK CHUNG,EUNSAM KIM,JONATHAN C.L. LIU: ""An Efficient Storage Utilization for High-Quality Content Distribution in a PVR-based Community"", 《GLOBLECOM 2009-2009 IEEE GLOBAL TELECOMMUNICATION CONFERENCE》 * |
武勇: ""基于Web服务的Internet文件共享系统的研究与实现"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112737977A (en) * | 2020-12-28 | 2021-04-30 | 苏州浪潮智能科技有限公司 | Data packet processing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108011704B (en) | 2020-10-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20180352047A1 (en) | Method for bluetooth communication, electronic device and bluetooth system | |
CN107637125B (en) | Method and apparatus for managing buffers in a wireless communication system | |
WO2018149879A8 (en) | Data interface device for use on a numerically controlled machine tool | |
CN109644352A (en) | Activation and the method and terminal device for deactivating secondary cell | |
CN109428697A (en) | Data transmission method, the network equipment and terminal device | |
US11006351B2 (en) | Wireless communication method and device | |
CN106797557A (en) | The method and terminal of data transfer | |
CN104407986B (en) | The method, apparatus and controller of allocating cache in storage device | |
CN108011704A (en) | Half-duplex communications device and its communication means, the device of half-duplex operation | |
CN106856589A (en) | User terminal time resource distribution method and device | |
CN107070625A (en) | The distribution method and device of a kind of code block group in transmission block | |
WO2021031972A1 (en) | Information feedback method and device, information receiving method and device, and storage medium | |
CN104852812B (en) | 1553B buses far set unit self-adapting transceiving data method | |
CN104158913B (en) | A kind of test method of display interfaces | |
CN108476408A (en) | The method of adjustment and device of upstream bandwidth | |
CN106330752A (en) | Method and device for determining receiving window in TCP flow control | |
CN103347071A (en) | MIPI data transmission control method and electronic device | |
CN105704037A (en) | Table item storage method and controller | |
CN106793094A (en) | Uplink resource allocating method, device and base station | |
US11088968B2 (en) | Controlling socket receive buffer for traffic optimization | |
CN113765819B (en) | Resource access method, device, electronic device and storage medium | |
CN101719063A (en) | Software interface realizing method and device with zero-copy function | |
CN101854296B (en) | Method, device and system for contracting with variable frequency | |
US20140184614A1 (en) | Method and Apparatus for Image Capture in Transmitter of Wireless Communications System | |
CN106603214B (en) | Data transmission method and device |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |