WO2021258696A1 - 通信数据处理方法、装置、计算机设备和存储介质 - Google Patents

通信数据处理方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2021258696A1
WO2021258696A1 PCT/CN2020/140014 CN2020140014W WO2021258696A1 WO 2021258696 A1 WO2021258696 A1 WO 2021258696A1 CN 2020140014 W CN2020140014 W CN 2020140014W WO 2021258696 A1 WO2021258696 A1 WO 2021258696A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
server
occupancy rate
memory
data
Prior art date
Application number
PCT/CN2020/140014
Other languages
English (en)
French (fr)
Inventor
仇文久
宋德超
王沅召
张家琪
杨东皓
Original Assignee
珠海格力电器股份有限公司
珠海联云科技有限公司
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 珠海格力电器股份有限公司, 珠海联云科技有限公司 filed Critical 珠海格力电器股份有限公司
Publication of WO2021258696A1 publication Critical patent/WO2021258696A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to a communication data processing method, device, computer equipment, and storage medium.
  • the server's data processing pressure has increased.
  • the communication data received by the first server is often sent to the second server through TCP (Transmission Control Protocol).
  • TCP communication requires After the data is completed, the memory will be released only after receiving the feedback information of the completion of the distribution returned by the second server.
  • the amount of data is large, when the occupancy rate of the memory of the first server is too high, the first server cannot receive instructions in time, resulting in data loss.
  • the present disclosure provides a communication data processing method, device, computer equipment, and storage medium.
  • the present disclosure provides a communication data processing method, including:
  • an activation instruction for activating the second channel is generated, and executed
  • the activation instruction is used to enable the second channel to transmit data that is not put in the first channel in the first server, and the data transmitted on the second channel is buffered in a message queue.
  • the method further includes:
  • the first channel is used to transmit the data that has been put into the first channel.
  • the method further includes:
  • a second instruction is generated, and the second instruction is executed.
  • the second instruction is set to block the second channel so that the second channel In an inactive state.
  • the memory occupancy rate includes a first occupancy rate and a second occupancy rate
  • the detecting the memory occupancy rate of the first server includes:
  • the occupancy rate of all the memory in the first server is detected to obtain the second occupancy rate.
  • the method further includes:
  • the data transmission of the first channel is performed by a main thread
  • the data transmission of the second channel is performed by a child thread of the main thread.
  • the method further includes:
  • the step of generating an activation instruction for activating the second channel is executed.
  • this embodiment provides a communication data processing device, the device including:
  • a first detection module configured to detect a memory occupancy rate of a first server to obtain a first memory occupancy rate, the first server including the first channel and the second channel;
  • the activation module is configured to generate an activation module for activating the second channel when the first channel is in a communication state, the second channel is in an inactive state, and the first memory occupancy rate is greater than or equal to a preset threshold.
  • the channel activation instruction executes the activation instruction so that the second channel transmits data that is not put in the first channel in the first server, and the data transmitted by the second channel is buffered in a message queue.
  • a computer device includes a memory, a processor, and a computer program that is stored on the memory and can run on the processor, and the processor implements the following steps when the processor executes the computer program:
  • an activation instruction for activating the second channel is generated, and executed
  • the activation instruction is used to enable the second channel to transmit data that is not put in the first channel in the first server, and the data transmitted on the second channel is buffered in a message queue.
  • the second channel When the first channel is in the communication state, the second channel is in the inactive state, and the first memory occupancy rate is greater than or equal to the preset threshold, an activation instruction for activating the second channel is generated, and the execution The activation instruction is used to enable the second channel to transmit data that is not put in the first channel in the first server, and the data transmitted on the second channel is buffered in a message queue.
  • the above-mentioned communication data processing method, device, computer equipment and storage medium includes: detecting the memory occupancy rate of the first server to obtain the first memory occupancy rate, the first server including the first channel and the first memory occupancy rate; Two channels; when the first channel is in a communication state, the second channel is in an inactive state, and the first memory occupancy rate is greater than or equal to a preset threshold, an activation for activating the second channel is generated Instruction to execute the activation instruction, so that the second channel transmits data that is not put in the first channel in the first server, and the data transmitted on the second channel is buffered in a message queue.
  • the amount of data is large and the memory occupancy rate of the server is too high, the server cannot continue to receive new data.
  • the untransmitted data is cached in the message queue to avoid the memory caused by the large amount of instruction data Insufficiency, which leads to the problem of data loss, the use of dual-threaded transmission improves communication efficiency.
  • FIG. 1 is a schematic flowchart of a communication data processing method in an embodiment
  • Figure 2 is a structural block diagram of a communication data processing device in an embodiment
  • Fig. 3 is an internal structure diagram of a computer device in an embodiment.
  • the communication data processing method is applied to a communication data processing system.
  • the communication data processing system includes a first server and a second server.
  • the first server and the second server are connected through a network.
  • the first server and the second server can be implemented by independent servers or a server cluster composed of multiple servers.
  • the communication data processing system can be applied to any scenario that requires command data communication, such as air-conditioning rental systems, household equipment control systems, and so on.
  • FIG. 1 is a schematic flowchart of a communication data processing method in an embodiment, and referring to FIG. 1, a communication data processing method is provided.
  • the method is mainly applied to the first server in FIG. 1 as an example.
  • the communication data processing method specifically includes the following steps:
  • Step S210 Detect a memory occupancy rate of a first server to obtain a first memory occupancy rate.
  • the first server includes the first channel and the second channel.
  • the monitoring module is used to monitor the CPU (central processing unit, central processing unit) occupancy and memory occupancy of the first server, and the memory occupancy rate of the first server is calculated according to the monitoring situation.
  • the monitoring module may be Any code encapsulation module that can realize the function of monitoring threads, such as existing memory monitoring scripts, JVisualVM tools, gopprof modules, etc.
  • Step S220 When the first channel is in the communication state, the second channel is in the inactive state, and the first memory occupancy rate is greater than or equal to the preset threshold, generate an activation instruction for activating the second channel, and execute all The activation instruction is used to enable the second channel to transmit data that is not put into the first channel in the data receiving service, and the data transmitted on the second channel is buffered in a message queue.
  • the preset threshold represents the memory occupancy rate of the first server.
  • the first memory occupancy rate exceeds the preset threshold, it indicates that the memory of the first server is about to be full and cannot continue to receive instruction data, and the monitoring module issues The activation signal is sent to the second channel to activate the second channel.
  • the data received by the first server after activating the second channel but not put into the first channel is buffered in the message queue through the second channel, and the data is transmitted through the second channel
  • the second server extracts data from the message queue for consumption, does not occupy the memory of the first server, theoretically guarantees that the first server can continuously receive instruction data, and avoids the memory of the first server when the amount of data is large Insufficient cannot continue to receive data, leading to the problem of command data loss during communication.
  • the data processing status of the data transmitted through the first channel is received; when the data processing status of the current data is that the transmission is completed, a recovery instruction is generated, and the recovery instruction is set to recover the current data corresponding to Memory.
  • a recovery instruction is generated, and the GC mechanism (garbage collection mechanism) is used to recover the data that has been delivered to the second server on the first channel, and the memory occupied by this type of data is released to facilitate subsequent follow-up Continue to receive command data.
  • the first server automatically reclaims the memory corresponding to the data.
  • the first channel is used to transmit the data that has been put into the first channel.
  • the data that has been put into the first channel is transmitted to the second server through the first channel, and the first server and the second server implement TCP communication through the first channel, and are processed in parallel with the second channel at the same time, that is, dual-threaded processing.
  • the command data that could not be processed is issued in time, the transmission speed of a single queue waiting for command response is improved, and the communication efficiency is improved.
  • the memory occupancy rate of the first server is detected. If the memory occupancy rate is still greater than the preset threshold, the first channel is blocked and the first channel no longer performs data transmission.
  • the server receives the data Both are buffered to the message queue through the second channel. Since the first server sends the instruction data to the second server, the first server needs to wait for the second server to reply before sending the next data. When the second server does not respond to the first server in time, the data transmission cannot be continued. Releasing the memory occupied by the data affects the efficiency of data transmission. Therefore, the first channel is blocked, so that the first channel no longer transmits data.
  • the data is buffered into the message queue through the second channel, and the second server takes the data from the message queue. The first server does not need to wait for the response of the second server to send data to the second server, which improves the efficiency of data transmission and reduces the communication pressure between the first server and the second server.
  • the first channel includes at least one TCP communication channel.
  • TCP communication has fast data transmission speed and is suitable for use when the amount of data is relatively small. However, waiting for TCP to release the memory for a long time, the data will occupy the memory of the first server for a period of time, and the message queue communication releases the data memory of the first server faster.
  • the memory occupancy rate of the first server is detected to obtain a second memory occupancy rate; when the second memory occupancy rate is less than the preset threshold, A second instruction is generated, and the second instruction is executed, and the second instruction is set to block the second channel, so that the second channel is in an inactive state.
  • the memory occupancy rate of the first server is detected, and the memory occupancy rate detected within the preset time period is less than a preset threshold, or the second memory occupancy rate obtained in each of the multiple detections is equal to If it is less than the preset threshold, an instruction to block the second channel is generated.
  • the preset duration and detection times can be customized according to the actual situation.
  • the memory occupancy rate includes a first occupancy rate and a second occupancy rate, and the memory space opened up by the first server within a preset time period is detected to obtain the first occupancy rate; The occupancy rate of all the memory in the first server is obtained, and the second occupancy rate is obtained.
  • the first occupancy rate corresponds to the ratio of the amount of newly opened memory of the first server to the maximum amount of memory of the first server during the preset time period
  • the second occupancy rate corresponds to the total amount of memory that the first server has opened up during the preset time period.
  • the preset threshold includes the preset development amount and the preset total. When the first occupancy rate is greater than the preset development amount and the second occupancy rate is greater than the preset total amount, the The memory occupancy rate of a server is greater than the preset threshold, which indicates that the memory of the first server is insufficient and cannot continue to receive command data.
  • the second channel needs to be activated to relieve communication pressure and avoid losing command data.
  • the first server receives the data and monitors the memory status of the first server through the gopprof monitoring module to determine whether the child thread is activated. If the child thread is not activated, the first server calls the TCP communication interface of the second server , The first server performs TCP communication with the second server through the main thread, that is, the first server performs TCP communication with the second server through the first channel, and blocks the child threads of the main thread, that is, no data is put into the second channel. The first server waits for the TCP response of the second server, and after receiving the response of the second server, the data that has been transmitted in the first channel is recovered through the GC mechanism, and the memory occupied by the data is released.
  • the monitoring module According to the monitoring results of the gopprof monitoring module, it is found that within the preset time period, when the first occupancy rate is greater than the preset development amount, and the second occupancy rate is greater than the preset total amount, that is, the memory occupancy rate of the first server is greater than the preset amount.
  • Set a threshold the amount of data received by the first server is too large, the monitoring module generates flag information, and continues to invest in the second channel, the main thread loops to detect whether there is flag information in the second channel, when the main thread detects the flag in the second channel When information, activate the sub-thread, put the data that has not been put in the first channel into the second channel, and buffer the data into the message queue through the second channel.
  • the first channel continues to maintain TCP communication until the first channel
  • the existing data transmission is completed, if the first server detects that the memory occupancy rate is still greater than the preset threshold at this time, the first channel will no longer perform data transmission, and the data received by the first server will be buffered to the message queue through the second channel , Until it is detected that the memory occupancy rate of the first server continues to be less than the preset threshold.
  • the first server will automatically release the data memory after communicating through the message queue.
  • the second server receives the instruction data sent by the first server through the first channel through the TCP communication interface, and extracts the instruction data from the message queue through the consumer. When there is no data in the message queue, the consumer is blocked. When there is an instruction in the message queue When data, start the consumer to extract data from the message queue.
  • the first occupancy rate is continuously less than the preset development amount
  • the second occupancy rate is continuously less than the preset total amount, that is, the memory occupancy rate of the first server is less than
  • the preset threshold value prohibits the monitoring module from putting the flag information into the second channel. If the main thread does not detect the presence of flag information in the second channel, the second channel is blocked, the sub-thread is in an inactive state, and the first server calls the second server again
  • the TCP communication interface puts data into the first channel, and performs data transmission with the second server through TCP communication.
  • Fig. 1 is a schematic flowchart of a communication data processing method in an embodiment. It should be understood that although the various steps in the flowchart of FIG. 1 are displayed in sequence as indicated by the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless specifically stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least part of the steps in FIG. 1 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution of these sub-steps or stages The sequence is not necessarily performed sequentially, but may be performed alternately or alternately with other steps or at least a part of sub-steps or stages of other steps.
  • a communication data processing device including:
  • the first detection module 310 is configured to detect a memory occupancy rate of a first server to obtain a first memory occupancy rate, where the first server includes the first channel and the second channel;
  • the activation module 320 is configured to generate a signal for activating the first channel when the first channel is in a communication state, the second channel is in an inactive state, and the first memory occupancy rate is greater than or equal to a preset threshold.
  • the activation instruction of the second channel executes the activation instruction so that the second channel transmits the data that is not put in the first channel in the first server, and the data transmitted by the second channel is buffered in a message queue.
  • the device further includes:
  • the first channel transmission module is configured to use the first channel to transmit when the first channel is in the communication state, the second channel is in the inactive state, and the first memory occupancy rate is greater than or equal to the preset threshold. Data of the first channel.
  • the device further includes:
  • the second detection module is set to detect the memory occupancy rate of the first server after activating the second channel to obtain the second memory occupancy rate
  • the second blocking module is configured to generate a second instruction and execute the second instruction when the second memory occupancy rate is less than the preset threshold, and the second instruction is set to block the second channel , So that the second channel is in an inactive state.
  • the memory occupancy rate includes a first occupancy rate and a second occupancy rate
  • the device further includes:
  • the first occupancy rate detection module is configured to detect the memory space opened up by the first server within a preset time period to obtain the first occupancy rate
  • the second occupancy rate detection module is configured to detect all the memory occupancy rates in the first server to obtain the second occupancy rate.
  • the device further includes:
  • the status receiving module is set to receive the data processing status of the data transmitted through the first server
  • the recycling module is configured to generate a recycling instruction when the data processing status of the current data is the transmission completion, and the recycling instruction is set to recover the memory corresponding to the current data.
  • the device further includes:
  • the standard information generating module is set to generate flag information, and put the flag information into the second channel;
  • the flag detection module is set to detect whether the flag information exists in the sub-thread through the main thread
  • the execution module is configured to execute the step of generating an activation instruction for activating the second channel when the flag information exists.
  • Fig. 3 shows an internal structure diagram of a computer device in an embodiment.
  • the computer device may specifically be the first server (or the second server 120) in FIG. 1.
  • the computer equipment includes the computer equipment including a processor, a memory, a network interface, an input device, and a display screen connected through a system bus.
  • the memory includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium of the computer device stores an operating system and may also store a computer program.
  • the processor can realize the communication data processing method.
  • a computer program can also be stored in the internal memory, and when the computer program is executed by the processor, the processor can execute the communication data processing method.
  • the display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen. It can be an external keyboard, touchpad, or mouse.
  • FIG. 3 is only a block diagram of a part of the structure related to the solution of the present disclosure, and does not constitute a limitation on the computer device to which the solution of the present disclosure is applied.
  • the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • the communication data processing apparatus provided in the present disclosure may be implemented in the form of a computer program, and the computer program may run on the computer device as shown in FIG. 3.
  • the memory of the computer device can store various program modules that make up the communication data processing apparatus, for example, the first detection module 310 and the activation module 320 shown in FIG. 2.
  • the computer program composed of each program module causes the processor to execute the steps in the communication data processing method of each embodiment of the present disclosure described in this specification.
  • the computer device shown in FIG. 3 can detect the memory occupancy rate of the first server through the first detection module 310 in the communication data processing apparatus shown in FIG. 2 to obtain the first memory occupancy rate.
  • the first server includes all The first channel and the second channel.
  • the computer device may execute, through the activation module 320, when the first channel is in a communication state, the second channel is in an inactive state, and the first memory occupancy rate is greater than or equal to a preset threshold, generating a method for activating the
  • the activation instruction of the second channel executes the activation instruction so that the second channel transmits data that is not put in the first channel in the first server, and the data transmitted by the second channel is buffered in a message queue.
  • a computer device including a memory, a processor, and a computer program stored on the memory and running on the processor.
  • the processor executes the computer program, the following steps are implemented: detecting the memory of the first server Occupancy rate, the first memory occupancy rate is obtained, the first server includes the first channel and the second channel; when the first channel is in the communication state, the second channel is in the inactive state, and all
  • the first memory occupancy rate is greater than or equal to the preset threshold
  • an activation instruction for activating the second channel is generated, and the activation instruction is executed, so that the second channel transmits the unavailable locations in the first server.
  • the data of the first channel and the data transmitted on the second channel are buffered in the message queue.
  • the processor further implements the following step when executing the computer program: after activating the second channel, the first channel is used to transmit the data that has been put into the first channel.
  • the processor further implements the following steps when executing the computer program: after the second channel is activated, the memory occupancy rate of the first server is detected to obtain the second memory occupancy rate; when the second memory occupancy rate is When the rate is less than the preset threshold, a second instruction is generated, and the second instruction is executed.
  • the second instruction is set to block the second channel so that the second channel is in an inactive state.
  • the processor further implements the following steps when executing the computer program: the memory occupancy rate includes a first occupancy rate and a second occupancy rate, and detecting the memory space opened up by the first server within a preset time period, Obtain the first occupancy rate; detect all the memory occupancy rates in the first server to obtain the second occupancy rate.
  • the processor further implements the following steps when executing the computer program: receiving the data processing status of the data transmitted through the first server; when the current data processing status is the completion of the transmission, generating a recovery instruction, the The reclaim instruction is set to reclaim the memory corresponding to the current data.
  • the processor further implements the following steps when executing the computer program: after activating the second channel, generating flag information, putting the flag information into the second channel; and detecting the Whether the flag information exists in the sub-thread; when the flag information exists, the step of generating the activation instruction for activating the second channel is executed.
  • a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed by a processor, the following steps are implemented: detecting the memory occupancy rate of a first server to obtain the first memory occupancy rate, The first server includes the first channel and the second channel; when the first channel is in a communication state, the second channel is in an inactive state, and the first memory occupancy rate is greater than or equal to the preset
  • the threshold is set, an activation instruction for activating the second channel is generated, and the activation instruction is executed so that the second channel transmits data that is not input to the first channel in the first server.
  • the data transmitted on the two-channel is buffered to the message queue.
  • the following steps are further implemented: after the second channel is activated, the first channel is used to transmit the data that has been put into the first channel.
  • the memory occupancy rate includes a first occupancy rate and a second occupancy rate
  • the memory space opened up by the first server is detected within a preset time period.
  • To obtain the first occupancy rate detect all the memory occupancy rates in the first server to obtain the second occupancy rate.
  • the following steps are further implemented: after the second channel is activated, the memory occupancy rate of the first server is detected to obtain the second memory occupancy rate; When the occupancy rate is less than the preset threshold, a second instruction is generated, and the second instruction is executed. The second instruction is set to block the second channel, so that the second channel is in an inactive state.
  • the following steps are further implemented: after the second channel is activated, flag information is generated, and the flag information is put into the second channel; Whether the flag information exists in the sub-thread; when the flag information exists, the step of generating an activation instruction for activating the second channel is executed.
  • the following steps are further implemented: receiving the data processing status of the data transmitted through the first server; when the current data processing status is the completion of the transmission, generating a recovery instruction, so The recovery instruction is set to recover the memory corresponding to the current data.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Channel
  • memory bus Radbus direct RAM
  • RDRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

本公开涉及一种通信数据处理方法、装置、计算机设备和存储介质。方法包括:检测第一服务器的内存占有率,得到第一内存占有率,第一服务器包括第一信道和第二信道;当第一信道处于通信状态,第二信道处于未激活状态,且第一内存占有率大于或等于预设阈值时,生成用于激活第二信道的激活指令,执行激活指令,以使第二信道传输第一服务器中的未投入第一信道的数据,第二信道传输的数据缓存至消息队列。在数据量较大时,通过激活的第二信道将未传输的指令数据缓存至消息队列中,避免由于指令数据量大带来的内存不足,从而导致数据的丢失的问题

Description

通信数据处理方法、装置、计算机设备和存储介质
本公开要求于2020年06月24日提交中国专利局、申请号为202010588618.X、发明名称为“通信数据处理方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及计算机技术领域,尤其涉及一种通信数据处理方法、装置、计算机设备和存储介质。
背景技术
随着通信数据的增加,增大了服务器对数据的处理压力,相关技术中常将第一服务器接收到的通信数据通过TCP(Transmission Control Protocol,传输控制协议)下发给第二服务器,TCP通信需要在数据下方完成后接受到第二服务器返回的下发完成的反馈信息后,才会释放内存。当数据量较大时,第一服务器的内存的占用率过高时,导致第一服务器无法及时接收指令,从而导致数据丢失。
发明内容
为了解决通信时由于服务器内存不足导致数据丢失的技术问题,本公开提供了一种通信数据处理方法、装置、计算机设备和存储介质。
第一方面,本公开提供了一种通信数据处理方法,包括:
检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道;
当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第 二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
在一些实施方式中,激活所述第二信道之后,所述方法还包括:
采用所述第一信道传输已投入所述第一信道的数据。
在一些实施方式中,所述激活所述第二信道之后,所述方法还包括:
检测所述第一服务器的内存占有率,得到第二内存占有率;
当所述第二内存占有率小于所述预设阈值时,生成第二指令,执行所述第二指令,所述第二指令被设置为阻塞所述第二信道,以使所述第二信道处于未激活状态。
在一些实施方式中,所述内存占有率包括第一占有率和第二占有率,所述检测第一服务器的内存占有率,包括:
检测预设时间段内,所述第一服务器开辟的内存空间,得到所述第一占有率;
检测所述第一服务器中全部内存占有率,得到所述第二占有率。
在一些实施方式中,所述方法还包括:
接收通过所述第一信道传输的数据的数据处理状态;
当当前数据的数据处理状态为传输完成时,生成回收指令,所述回收指令被设置为回收所述当前数据对应的内存。
在一些实施方式中,通过主线程执行所述第一信道的数据传输,通过所述主线程的子线程执行所述第二信道的数据传输。
在一些实施方式中,激活所述第二信道之后,所述方法还包括:
生成标志信息,将所述标志信息放入所述第二信道;
通过所述主线程检测所述子线程中是否存在所述标志信息;
当存在所述标志信息时,执行所述生成用于激活所述第二信道的 激活指令的步骤。
第二方面,本实施例提供了一种通信数据处理装置,所述装置包括:
第一检测模块,被设置为检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道;
激活模块,被设置为当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道;
当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:
检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道;
当所述第一信道处于通信状态,所述第二信道处于未激活状态, 且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
上述通信数据处理方法、装置、计算机设备和存储介质,所述方法包括:检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道;当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。当数据量较大时,服务器的内存占有率过高时,服务器无法继续接收新的数据,通过激活第二信道将未传输的数据缓存至消息队列中,避免由于指令数据量大带来的内存不足,从而导致数据的丢失的问题,采用双线程传输提高了通信效率。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为一个实施例中通信数据处理方法的流程示意图;
图2为一个实施例中通信数据处理装置的结构框图;
图3为一个实施例中计算机设备的内部结构图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开的一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
该通信数据处理方法应用于通信数据处理系统。该通信数据处理系统包括第一服务器和第二服务器。第一服务器和第二服务器通过网络连接。第一服务器和第二服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。该通信数据处理系统可应用于任何需要进行指令数据通信的场景,例如空调租赁系统、家居设备控制系统等。
在一个实施例中,图1为一个实施例中一种通信数据处理方法的流程示意图,参照图1,提供了一种通信数据处理方法。本实施例主要以该方法应用于上述图1中的第一服务器来举例说明,该通信数据处理方法具体包括如下步骤:
步骤S210,检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道。
在本实施例中,利用监听模块监听第一服务器中的CPU(central processing unit,中央处理器)占用情况和内存占用情况,根据监听情况计算得出第一服务器的内存占有率,监听模块可以为任何能够实现监听线程功能的代码封装模块,例如现有的内存监听脚本、JVisualVM工具、gopprof模块等。
步骤S220,当第一信道处于通信状态,第二信道处于未激活状态, 且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述数据接收服务中的未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
在本实施例中,预设阈值表示第一服务器的内存占用率,当第一内存占有率超过预设阈值时,表示第一服务器的内存即将占满,无法继续接收指令数据,监听模块下发激活信号至第二信道中,以激活第二信道,第一服务器在激活第二信道后接收的、未投入第一信道的数据通过第二信道缓存至消息队列中,通过第二信道将数据传输至第二服务器的消息队列中,第二服务器从消息队列中提取数据进行消费,不占用第一服务器的内存,理论上保证第一服务器可连续接收指令数据,避免数据量大时第一服务器内存不足无法继续接收数据,导致通信过程中指令数据丢失的问题。
在一个实施例中,接收通过所述第一信道传输的数据的数据处理状态;当当前数据的数据处理状态为传输完成时,生成回收指令,所述回收指令被设置为回收所述当前数据对应的内存。
具体地,在第一服务器下发数据完成后,生成回收指令,利用GC机制(垃圾回收机制)回收第一信道已下发至第二服务器的数据,释放该类数据所占用的内存,便于后续继续接收指令数据。数据通过第二信道缓存至消息队列后,第一服务器自动回收数据对应的内存。
在一个实施例中,激活所述第二信道之后,采用所述第一信道传输已投入所述第一信道的数据。
具体地,已投入第一信道的数据通过第一信道传输至第二服务器,第一服务器和第二服务器之间通过第一信道实现TCP通信,同时与第二信道并行处理,即双线程处理,使原本不能处理的指令数据及时下发,提高了单一排队等待指令响应的传输速度,提高了通信效率。
当第一信道内的数据下发完后,检测第一服务器的内存占有率,若该内存占有率仍大于预设阈值,阻塞第一信道,第一信道不再进行数据传输,服务器接收的数据均通过第二信道缓存至消息队列。由于第一服务器发送指令数据至第二服务器后,第一服务器需等待第二服务器回复响应后才可发送下一个数据,当第二服务器没有及时响应第一服务器时,无法继续进行数据传输,无法释放数据所占用的内存,影响数据传输效率,因此阻塞第一信道,令第一信道不再传输数据,通过第二信道将数据缓存至消息队列中,第二服务器从消息队列中拿取数据,第一服务器向第二服务器发送数据无需等待第二服务器的响应,提高了数据传输效率,减轻了第一服务器与第二服务器之间的通信压力。第一信道包括至少一个TCP通信信道。
TCP通信数据传输速度快,适合数据量比较少的情况下使用,但等待TCP释放内存时间长,数据会占用第一服务器内存一段时间,消息队列通信释放第一服务器中数据内存较快。
在一个实施例中,所述激活所述第二信道之后,检测所述第一服务器的内存占有率,得到第二内存占有率;当所述第二内存占有率小于所述预设阈值时,生成第二指令,执行所述第二指令,所述第二指令被设置为阻塞所述第二信道,以使所述第二信道处于未激活状态。
具体地,在预设时长内,检测第一服务器的内存占有率,在预设时长内检测的内存占有率小于预设阈值,或多次检测中的每次检测得到的第二内存占有率均小于预设阈值,生成阻塞第二信道的指令。进行多次检测,并且每次都小于预设阈值时,表示第一服务器接收的数据量减少,且减少后相对稳定,第一服务器可以继续接收指令数据,且采用第一信道与第二服务器进行TCP通信,可以满足数据的传输需求。预设时长和检测次数可根据实际情况自定义。
在一个实施例中,所述内存占有率包括第一占有率和第二占有率, 检测预设时间段内,所述第一服务器开辟的内存空间,得到所述第一占有率;检测所述第一服务器中全部内存占有率,得到所述第二占有率。
具体地,第一占有率为预设时间段内第一服务器新开辟的内存量与第一服务器最大内存量的比值,第二占有率对应预设时间段内第一服务器已开辟的内存总量与第一服务器最大内存量的比值,预设阈值包括预设开辟量和预设总量,当第一占有率大于预设开辟量时,且第二占有率大于预设总量时,即第一服务器的内存占有率大于预设阈值,表示第一服务器的内存不足,无法通过继续接收指令数据,需要激活第二信道缓解通信压力,避免丢失指令数据。
在一个具体实施例中,第一服务器接收数据,并通过gopprof监听模块监听第一服务器的内存情况,判断子线程是否激活,若子线程没有处于激活状态,第一服务器调用第二服务器的TCP通信接口,第一服务器通过主线程与第二服务器进行TCP通信,即第一服务器通过第一信道与第二服务器进行TCP通信,阻塞主线程的子线程,即没有数据投入第二信道中。第一服务器等待第二服务器的TCP响应,当接收到第二服务器的响应之后,通过GC机制将第一信道已传输完成的数据进行回收,释放数据所占的内存。
当根据gopprof监听模块的监听结果发现,在预设时间段内,第一占有率大于预设开辟量时,且第二占有率大于预设总量时,即第一服务器的内存占有率大于预设阈值,第一服务器接收的数据量过大,监听模块生成标志信息,并持续投入第二信道中,主线程循环检测第二信道中是否存在标志信息,当主线程检测到第二信道中的标志信息时,激活子线程,将未投入第一信道中的数据投入第二信道中,通过第二信道将数据缓存至消息队列中,此时第一信道继续保持TCP通信,直至将第一信道中已有的数据传输完成,若此时第一服务器检测得到内 存占有率仍大于预设阈值时,则第一信道不再进行数据传输,第一服务器接收的数据均通过第二信道缓存至消息队列中,直至检测发现第一服务器的内存占有率持续小于预设阈值。第一服务器将通过消息队列通信后的数据内存自动释放。通过此方法完成第一服务器的动态扩展,扩大第一服务器最大处理容量,防止第一服务器因为通信峰值导致的数据缺失和服务器响应问题。
第二服务器通过TCP通信接口接收第一服务器通过第一信道发送的指令数据,且通过消费者从消息队列中提取指令数据,当消息队列中没有数据时,阻塞消费者,当消息队列中存在指令数据时,启动消费者从消息队列中提取数据。
当根据gopprof监听模块的监听结果发现,在预设时长内,第一占有率持续小于预设开辟量时,且第二占有率持续小于预设总量时,即第一服务器的内存占有率小于预设阈值,禁止监听模块将标志信息投入第二信道中,主线程未检测到第二信道中存在标志信息,则阻塞第二信道,令子线程处于未激活状态,第一服务器重新调用第二服务器的TCP通信接口,将数据投入第一信道中,通过TCP通信与第二服务器进行数据传输。
图1为一个实施例中通信数据处理方法的流程示意图。应该理解的是,虽然图1的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图2所示,提供了一种通信数据处理装置,包括:
第一检测模块310,被设置为检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道;
激活模块320,被设置为当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
在一个实施例中,所述装置还包括:
第一信道传输模块,被设置为当第一信道处于通信状态,第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,采用所述第一信道传输已经投入所述第一信道的数据。
在一个实施例中,所述装置还包括:
第二检测模块,被设置为激活所述第二信道之后,检测所述第一服务器的内存占有率,得到第二内存占有率;
第二阻塞模块,被设置为当所述第二内存占有率小于所述预设阈值时,生成第二指令,执行所述第二指令,所述第二指令被设置为阻塞所述第二信道,以使所述第二信道处于未激活状态。
在一个实施例中,所述内存占有率包括第一占有率和第二占有率,所述装置还包括:
第一占有率检测模块,被设置为检测预设时间段内,所述第一服务器开辟的内存空间,得到所述第一占有率;
第二占有率检测模块,被设置为检测所述第一服务器中全部内存占有率,得到所述第二占有率。
在一个实施例中,所述装置还包括:
状态接收模块,被设置为接收通过所述第一服务器传输的数据的 数据处理状态;
回收模块,被设置为当当前数据的数据处理状态为传输完成时,生成回收指令,所述回收指令被设置为回收所述当前数据对应的内存。
在一个实施例中,所述装置还包括:
标准信息生成模块,被设置为生成标志信息,将所述标志信息放入所述第二信道;
标志检测模块,被设置为通过所述主线程检测所述子线程中是否存在所述标志信息;
执行模块,被设置为当存在所述标志信息时,执行所述生成用于激活所述第二信道的激活指令的步骤。
图3示出了一个实施例中计算机设备的内部结构图。该计算机设备具体可以是图1中的第一服务器(或第二服务器120)。如图3所示,该计算机设备包括该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、输入装置和显示屏。其中,存储器包括非易失性存储介质和内存储器。该计算机设备的非易失性存储介质存储有操作系统,还可存储有计算机程序,该计算机程序被处理器执行时,可使得处理器实现通信数据处理方法。该内存储器中也可储存有计算机程序,该计算机程序被处理器执行时,可使得处理器执行通信数据处理方法。计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图3中示出的结构,仅仅是与本公开方案相关的部分结构的框图,并不构成对本公开方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,本公开提供的通信数据处理装置可以实现为一 种计算机程序的形式,计算机程序可在如图3所示的计算机设备上运行。计算机设备的存储器中可存储组成该通信数据处理装置的各个程序模块,比如,图2所示的第一检测模块310和激活模块320。各个程序模块构成的计算机程序使得处理器执行本说明书中描述的本公开各个实施例的通信数据处理方法中的步骤。
图3所示的计算机设备可以通过如图2所示的通信数据处理装置中的第一检测模块310执行检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道。计算机设备可通过激活模块320执行当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤:检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道;当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:激活所述第二信道之后,采用所述第一信道传输已经投入所述第一信道的数据。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:激活所述第二信道之后,检测所述第一服务器的内存占有率,得到第二 内存占有率;当所述第二内存占有率小于所述预设阈值时,生成第二指令,执行所述第二指令,所述第二指令被设置为阻塞所述第二信道,以使所述第二信道处于未激活状态。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:所述内存占有率包括第一占有率和第二占有率,检测预设时间段内,所述第一服务器开辟的内存空间,得到所述第一占有率;检测所述第一服务器中全部内存占有率,得到所述第二占有率。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:接收通过所述第一服务器传输的数据的数据处理状态;当当前数据的数据处理状态为传输完成时,生成回收指令,所述回收指令被设置为回收所述当前数据对应的内存。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:激活所述第二信道之后,生成标志信息,将所述标志信息放入所述第二信道;通过所述主线程检测所述子线程中是否存在所述标志信息;当存在所述标志信息时,执行所述生成用于激活所述第二信道的激活指令的步骤。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括所述第一信道和所述第二信道;当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:激活所述第二信道之后,采用所述第一信道传输已经投入所述第一信道的数据。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:所述内存占有率包括第一占有率和第二占有率,检测预设时间段内,所述第一服务器开辟的内存空间,得到所述第一占有率;检测所述第一服务器中全部内存占有率,得到所述第二占有率。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:激活所述第二信道之后,检测所述第一服务器的内存占有率,得到第二内存占有率;当所述第二内存占有率小于所述预设阈值时,生成第二指令,执行所述第二指令,所述第二指令被设置为阻塞所述第二信道,以使所述第二信道处于未激活状态。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:激活所述第二信道之后,生成标志信息,将所述标志信息放入所述第二信道;通过所述主线程检测所述子线程中是否存在所述标志信息;当存在所述标志信息时,执行所述生成用于激活所述第二信道的激活指令的步骤。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:接收通过所述第一服务器传输的数据的数据处理状态;当当前数据的数据处理状态为传输完成时,生成回收指令,所述回收指令被设置为回收所述当前数据对应的内存。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,本公开所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM 以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所示的这些实施例,而是要符合与本文所申请的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种通信数据处理方法,所述方法包括:
    检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括第一信道和第二信道;
    当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
  2. 根据权利要求1所述的方法,其中,所述激活所述第二信道之后,所述方法还包括:
    采用所述第一信道传输已投入所述第一信道的数据。
  3. 根据权利要求1所述的方法,其中,所述激活所述第二信道之后,所述方法还包括:
    检测所述第一服务器的内存占有率,得到第二内存占有率;
    当所述第二内存占有率小于所述预设阈值时,生成第二指令,执行所述第二指令,所述第二指令被设置为阻塞所述第二信道,以使所述第二信道处于未激活状态。
  4. 根据权利要求1所述的方法,其中,所述内存占有率包括第一占有率和第二占有率,所述检测第一服务器的内存占有率,包括:
    检测预设时间段内,所述第一服务器开辟的内存空间,得到所述第一占有率;
    检测所述第一服务器中全部内存占有率,得到所述第二占有率。
  5. 根据权利要求1所述的方法,其中,所述方法还包括:
    接收通过所述第一信道传输的数据的数据处理状态;
    当当前数据的数据处理状态为传输完成时,生成回收指令,所述 回收指令被设置为回收所述当前数据对应的内存。
  6. 根据权利要求1所述的方法,其中,通过主线程执行所述第一信道的数据传输,通过所述主线程的子线程执行所述第二信道的数据传输。
  7. 根据权利要求1所述的方法,其中,激活所述第二信道之后,所述方法还包括:
    生成标志信息,将所述标志信息放入所述第二信道;
    通过主线程检测所述主线程的子线程中是否存在所述标志信息;
    当所述子线程中存在所述标志信息时,执行所述生成被设置为激活所述第二信道的激活指令的步骤。
  8. 一种通信数据处理装置,所述装置包括:
    第一检测模块,被设置为检测第一服务器的内存占有率,得到第一内存占有率,所述第一服务器包括第一信道和第二信道;
    激活模块,被设置为当所述第一信道处于通信状态,所述第二信道处于未激活状态,且所述第一内存占有率大于或等于预设阈值时,生成用于激活所述第二信道的激活指令,执行所述激活指令,以使所述第二信道传输所述第一服务器中未投入所述第一信道的数据,所述第二信道传输的数据缓存至消息队列。
  9. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现权利要求1至7中任一项所述方法的步骤。
  10. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的方法的步骤。
PCT/CN2020/140014 2020-06-24 2020-12-28 通信数据处理方法、装置、计算机设备和存储介质 WO2021258696A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010588618.XA CN111858088B (zh) 2020-06-24 2020-06-24 通信数据处理方法、装置、计算机设备和存储介质
CN202010588618.X 2020-06-24

Publications (1)

Publication Number Publication Date
WO2021258696A1 true WO2021258696A1 (zh) 2021-12-30

Family

ID=72989263

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/140014 WO2021258696A1 (zh) 2020-06-24 2020-12-28 通信数据处理方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN111858088B (zh)
WO (1) WO2021258696A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115550080A (zh) * 2022-09-19 2022-12-30 苏州浪潮智能科技有限公司 一种网卡、数据传输系统、方法、计算机设备和存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858088B (zh) * 2020-06-24 2024-06-14 珠海格力电器股份有限公司 通信数据处理方法、装置、计算机设备和存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008097184A (ja) * 2006-10-10 2008-04-24 Nippon Hoso Kyokai <Nhk> アクセス負荷制御装置、その方法およびそのプログラム、ならびに、投稿受付システム
CN103390049A (zh) * 2013-07-23 2013-11-13 南京联创科技集团股份有限公司 一种基于内存数据库缓存的高速消息队列溢出的处理方法
CN104038439A (zh) * 2014-06-18 2014-09-10 中国工商银行股份有限公司 报文流量控制方法及系统
CN107105015A (zh) * 2017-03-31 2017-08-29 北京奇艺世纪科技有限公司 一种数据流的分流方法及装置
CN109189577A (zh) * 2018-08-31 2019-01-11 武汉达梦数据库有限公司 一种数据同步时防止内存溢出的方法和装置
CN109344137A (zh) * 2018-10-09 2019-02-15 广东网安科技有限公司 一种日志存储方法及系统
CN111858088A (zh) * 2020-06-24 2020-10-30 珠海格力电器股份有限公司 通信数据处理方法、装置、计算机设备和存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6625117B1 (en) * 1999-09-30 2003-09-23 International Business Machines Corporation Method and apparatus for switching messages from a primary message channel to a secondary message channel in a message queuing system
CN101373990B (zh) * 2008-09-23 2012-09-05 北京星网锐捷网络技术有限公司 一种链路备份方法及装置
CN110149220B (zh) * 2014-12-30 2022-07-29 华为技术有限公司 一种管理数据传输通道的方法及装置
CN108243047B (zh) * 2016-12-27 2023-01-10 中兴通讯股份有限公司 一种业务切换方法、装置及业务切换系统
CN110943998B (zh) * 2019-12-04 2022-02-01 腾讯科技(深圳)有限公司 一种信号传输方法、装置、设备及介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008097184A (ja) * 2006-10-10 2008-04-24 Nippon Hoso Kyokai <Nhk> アクセス負荷制御装置、その方法およびそのプログラム、ならびに、投稿受付システム
CN103390049A (zh) * 2013-07-23 2013-11-13 南京联创科技集团股份有限公司 一种基于内存数据库缓存的高速消息队列溢出的处理方法
CN104038439A (zh) * 2014-06-18 2014-09-10 中国工商银行股份有限公司 报文流量控制方法及系统
CN107105015A (zh) * 2017-03-31 2017-08-29 北京奇艺世纪科技有限公司 一种数据流的分流方法及装置
CN109189577A (zh) * 2018-08-31 2019-01-11 武汉达梦数据库有限公司 一种数据同步时防止内存溢出的方法和装置
CN109344137A (zh) * 2018-10-09 2019-02-15 广东网安科技有限公司 一种日志存储方法及系统
CN111858088A (zh) * 2020-06-24 2020-10-30 珠海格力电器股份有限公司 通信数据处理方法、装置、计算机设备和存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115550080A (zh) * 2022-09-19 2022-12-30 苏州浪潮智能科技有限公司 一种网卡、数据传输系统、方法、计算机设备和存储介质

Also Published As

Publication number Publication date
CN111858088B (zh) 2024-06-14
CN111858088A (zh) 2020-10-30

Similar Documents

Publication Publication Date Title
US10152382B2 (en) Method and system for monitoring virtual machine cluster
WO2021258696A1 (zh) 通信数据处理方法、装置、计算机设备和存储介质
WO2021129367A1 (zh) 一种监控分布式存储系统的方法及装置
US10095576B2 (en) Anomaly recovery method for virtual machine in distributed environment
US10298469B2 (en) Automatic asynchronous handoff identification
US20180218058A1 (en) Data synchronization method and system
CN110597890B (zh) 数据采集系统、方法、节点设备及存储介质
WO2016127903A1 (zh) 一种数据同步方法、装置和系统
US11144330B2 (en) Algorithm program loading method and related apparatus
CN112650575B (zh) 资源调度方法、装置和云端服务系统
CN109062982B (zh) 财务数据交互方法、装置、计算机设备和存储介质
WO2019062019A1 (zh) 一种数据列表的导出方法及其终端
CN111294377B (zh) 一种依赖关系的网络请求发送方法、终端装置及存储介质
CN110333916A (zh) 请求消息处理方法、装置、计算机系统及可读存储介质
CN117251373A (zh) 压力测试方法、装置、设备以及存储介质
CN109933435B (zh) 控制方法、装置及计算机设备
CN110209497B (zh) 一种主机资源动态扩缩容的方法及系统
CN109257235B (zh) 网络异常恢复方法、装置、设备及计算机可读存储介质
WO2019020084A1 (zh) 一种数据存储的方法和系统
CN115858667A (zh) 用于同步数据的方法、装置、设备和存储介质
CN111935337B (zh) 聚合链路的mac地址保活方法、设备和存储介质
CN110519393B (zh) 自助设备的监管方法、装置、设备、服务器和介质
CN113761054A (zh) 数据调取方法、装置、电子设备及存储介质
CN111581446B (zh) 一种图关系生成方法、装置、系统、设备及存储介质
WO2024051738A1 (zh) 数据写入方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20942398

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20942398

Country of ref document: EP

Kind code of ref document: A1