WO2022213598A1 - 一种数据处理方法、装置及电子设备和存储介质 - Google Patents

一种数据处理方法、装置及电子设备和存储介质 Download PDF

Info

Publication number
WO2022213598A1
WO2022213598A1 PCT/CN2021/129521 CN2021129521W WO2022213598A1 WO 2022213598 A1 WO2022213598 A1 WO 2022213598A1 CN 2021129521 W CN2021129521 W CN 2021129521W WO 2022213598 A1 WO2022213598 A1 WO 2022213598A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
queue
data packets
sent
stranded
Prior art date
Application number
PCT/CN2021/129521
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 WO2022213598A1 publication Critical patent/WO2022213598A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application provides a data processing device, which is applied to data equipment, and the data equipment is connected to a host computer, and the device includes:
  • FIG. 1 a flowchart of a data processing method according to an exemplary embodiment, as shown in FIG. 1, includes:
  • the data device determines whether there are stranded data packets to be sent to the upper computer in the data transmission queue, and if so, sends the data packets in the data transmission queue to host computer. After all the data packets in the data transmission queue are sent, the stranded data packets are cleared, that is, all the data packets generated by the application or service that need to be sent to the upper computer are sent to the upper computer, and the data device enters the sleep state at this time.
  • S202 Send the data packets in the sending queue corresponding to the physical layer to the upper computer, so as to reduce the quantity of the stranded data;
  • the stranded data packets in the queue corresponding to the link layer are cleared. Since there are no stranded data packets in the queue corresponding to the link layer when the data device enters the sleep state, the When the data device exits the low power consumption mode and re-enters the working state, the host computer will not receive the incomplete stranded data packets of the link layer, which ensures that the data link between the data device and the host computer is normal. It can be seen that the data processing method provided by the embodiment of the present application improves the robustness and stability of the data device entering and exiting the low power consumption mode.
  • the execution body is a USB data device.
  • the USB data device includes a USB physical layer, a USB link layer, and an application layer.
  • the process of entering the sleep state is shown in FIG. 3 . :
  • the USB physical layer receives the sleep interrupt, notifies the application layer through the USB link layer, the application layer sets the sleep flag, stops adding data to the corresponding queue, and judges whether there is data being sent in the queue corresponding to the USB link layer. If there is data being sent in the queue corresponding to the USB link layer, the data packet in the sending queue corresponding to the physical layer is sent to the upper computer, and the application layer is notified through the USB link layer that the data packet is sent, and the application layer discards the corresponding data packet. For this packet in the queue, reduce the number of packets in the corresponding queue by one.
  • the data in the queue corresponding to the USB link layer flows into the sending queue corresponding to the physical layer, and continues to be sent to the host computer.
  • the number of data packets in the queue corresponding to the application layer is cleared, it responds to the sleep event and enters the sleep state. If there is no data being sent in the queue corresponding to the USB link layer, the USB data device directly enters the sleep state.
  • the following describes a data processing apparatus provided by an embodiment of the present application, and a data processing apparatus described below and a data processing method described above can be referred to each other.
  • FIG. 4 a structural diagram of a data processing apparatus according to an exemplary embodiment, as shown in FIG. 4, includes:
  • the sending module 402 is configured to send the data packets in the data transmission queue to the upper computer, so as to reduce the number of the stranded data packets;
  • the first control module 403 is configured to control the data device to enter a sleep state after all data packets in the data transmission queue are sent.
  • the data device determines whether there are stranded data packets to be sent to the upper computer in the data transmission queue, and if so, sends the data packets in the data transmission queue to host computer. After all the data packets in the data transmission queue are sent, the stranded data packets are cleared, that is, all the data packets generated by the application or service that need to be sent to the upper computer are sent to the upper computer, and the data device enters the sleep state at this time.
  • the data device includes an application layer, a link layer and a physical layer, and the physical layer is connected to the upper computer;
  • the sending module 402 is specifically a module for sending the data packets in the sending queue corresponding to the physical layer to the upper computer, so as to reduce the number of the stranded data packets;
  • the first control module 403 is specifically a module that controls the data device to enter a sleep state after all the data packets in the transmission queue corresponding to the physical layer are sent.
  • the second control module is configured to control the application layer to stop adding data packets to the corresponding queue after receiving the sleep instruction through the physical layer.
  • An update module configured to send a notification message to the application layer to clear the data packets that have been sent in the queue corresponding to the application layer, and update the number of data packets in the queue corresponding to the application layer.
  • a third control module configured to control the application layer to release the corresponding queue when the number of data packets in the queue corresponding to the application layer is zero.
  • the judgment module 401 includes:
  • a receiving unit configured to receive a target interrupt message, where the target interrupt message is used to instruct the data device to enter a dormant state
  • the judging unit is used for judging whether there are stranded data packets in the data sending queue.
  • the data device is specifically a USB data device.
  • the embodiments of the present application further provide an electronic device, and the electronic device may specifically be a module capable of realizing the above data processing function or including the module
  • the terminal equipment, etc., the terminal equipment may be a mobile terminal and/or a smart device, etc., and the mobile terminal may be at least one of a mobile phone, a tablet computer, a notebook computer, etc.
  • a module capable of realizing the above data processing function may be specifically 2G communication module, 3G communication module, 4G communication module, 5G communication module, NB-IOT (full name in Chinese: Narrow Band Internet of Things, full name in English: Narrow Band Internet of Things) communication module, etc.
  • FIG. 5 is a structural diagram of an electronic device according to an exemplary embodiment. As shown in FIG. 5, the electronic device includes:
  • Communication interface 1 which can exchange information with other devices such as network devices;
  • the processor 2 is connected to the communication interface 1 to realize information interaction with other devices, and is used to execute the data processing method provided by one or more of the above technical solutions when running the computer program.
  • the computer program is instead stored on the memory 3 .
  • bus system 4 is used to realize the connection communication between these components.
  • the bus system 4 also includes a power bus, a control bus and a status signal bus.
  • the various buses are labeled as bus system 4 in FIG. 5 .
  • the memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on an electronic device.
  • the memory 3 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory.
  • the non-volatile memory can be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-only memory) Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, ferromagnetic random access memory), Flash Memory (Flash Memory), Magnetic Surface Memory , CD-ROM, or CD-ROM (Compact Disc Read-Only Memory); magnetic surface memory can be disk memory or tape memory.
  • RAM Random Access Memory
  • SRAM Static Random Access Memory
  • SSRAM Synchronous Static Random Access Memory
  • DRAM Dynamic Random Access Memory
  • SDRAM Synchronous Dynamic Random Access Memory
  • DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • ESDRAM Enhanced Type Synchronous Dynamic Random Access Memory
  • SLDRAM Synchronous Link Dynamic Random Access Memory
  • DRRAM Direct Rambus Random Access Memory
  • the memory 2 described in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
  • the steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module may be located in a storage medium, the storage medium is located in the memory 3, and the processor 2 reads the program in the memory 3, and completes the steps of the foregoing method in combination with its hardware.
  • the embodiment of the present application further provides a storage medium, that is, a computer storage medium, specifically a computer-readable storage medium, for example, including a memory 3 storing a computer program, and the above-mentioned computer program can be executed by the processor 2, to complete the steps described in the preceding method.
  • the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM.
  • the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, execute It includes the steps of the above method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other media that can store program codes.
  • the above-mentioned integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they may also be stored in a computer-readable storage medium.
  • the computer software products are stored in a storage medium and include several instructions for An electronic device (which may be a personal computer, a server, or a network device, etc.) is caused to execute all or part of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other mediums that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

一种数据处理方法、装置及一种电子设备和计算机可读存储介质,该方法包括:接收休眠指令,判断数据发送队列中是否存在滞留数据包;其中,滞留数据包为待发送至上位机的数据包;若是,则将数据发送队列中的数据包发送至上位机,以减少滞留数据包的数量;在数据发送队列中的数据包全部发送完成后,控制数据设备进入休眠状态。由此可见,本申请提供的数据处理方法,提高了数据设备进入和退出低功耗模式的健壮性和稳定性。

Description

一种数据处理方法、装置及电子设备和存储介质
本申请要求于2021年4月7日提交中国专利局、申请号为202110372152.4、发明名称为“一种数据处理方法、装置及电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,更具体地说,涉及一种数据处理方法、装置及一种电子设备和一种计算机可读存储介质。
背景技术
数据设备与上位机连接,用于提供特定的应用程序或服务。在相关技术中,数据设备使用软件队列的方式处理数据的发送,即应用程序或服务产生需要发送至上位机的数据,将其加入队列中,进而传输至上位机。但是,在队列中的数据正在传输至上位机的过程中,若数据设备接收到进入低功耗模式的指令,立即进入低功耗模式,导致队列中存在滞留数据包,传输至上位机的数据包被截断。当数据设备退出低功耗时,上位机接收到不完整的滞留数据包时,会认为是数据链路发生了异常,从而导致数据链路不稳定。
因此,如何提高数据设备进入和退出低功耗模式的健壮性和稳定性是本领域技术人员需要解决的技术问题。
发明内容
本申请的目的在于提供一种数据处理方法、装置及一种电子设备和一种计算机可读存储介质,提高了数据设备进入和退出低功耗模式的健壮性和稳定性。
为实现上述目的,本申请提供了一种数据处理方法,应用于数据设备,所述数据设备与上位机连接,所述方法包括:
接收休眠指令,判断数据发送队列中是否存在滞留数据包;其中,所述滞留数据包为待发送至所述上位机的数据包;
若是,则将所述数据发送队列中的数据包发送至所述上位机,以减少所述滞留数据包的数量;
在所述数据发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
其中,所述数据设备包括应用层、链路层和物理层,所述物理层与上位机连接;
相应的,所述接收休眠指令,判断数据发送队列中是否存在滞留数据包,包括:
通过所述物理层接收休眠指令,判断所述链路层对应的队列中是否存在滞留数据包;
相应的,将所述数据发送队列中的数据包发送至所述上位机,包括:
将所述物理层对应的发送队列中的数据包发送至所述上位机;
相应的,在所述数据发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态,包括:
在所述物理层对应的发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
其中,所述通过所述物理层接收休眠指令之后,还包括:
控制所述应用层停止向对应的队列中添加数据包。
其中,将所述物理层对应的发送队列中的数据包发送至所述上位机之后,还包括:
向所述应用层发送通知消息,以清除所述应用层对应的队列中发送完成的数据包,并更新所述应用层对应的队列的数据包数量。
其中,所述更新所述应用层对应的队列的数据包数量之后,还包括:
若所述应用层对应的队列的数据包数量为零,则控制所述应用层释放对应的队列。
其中,所述接收休眠指令,包括:
接收目标中断消息,所述目标中断消息用于指示所述数据设备进入休眠状态。
其中,所述数据设备具体为USB数据设备。
为实现上述目的,本申请提供了一种数据处理装置,应用于数据设备,所述数据设备与上位机连接,所述装置包括:
判断模块,用于接收休眠指令,判断数据发送队列中是否存在滞留数据包;其中,所述滞留数据包为待发送至所述上位机的数据包;若是,则启动发送模块的工作流程;
所述发送模块,用于将所述数据发送队列中的数据包发送至所述上位机,以减少所述滞留数据包的数量;
第一控制模块,用于在所述数据发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
为实现上述目的,本申请提供了一种电子设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序时实现如上述数据处理方法的步骤。
为实现上述目的,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述数据处理方法的步骤。
通过以上方案可知,本申请提供的一种数据处理方法,包括:接收休眠指令,判断数据发送队列中是否存在滞留数据包;其中,所述滞留数据包为待发送至所述上位机的数据包;若是,则将所述数据发送队列中的数据包发送至所述上位机,以减少所述滞留数据包的数量;在所述数据发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
本申请提供的数据处理方法,在数据设备进入休眠状态前,数据设备判断数据发送队列中是否存在待发送至上位机的滞留数据包,若是,则将数据发送队列中的数据包发送至上位机。在数据发送队列中的数据包全部发送完成后,清除了滞留数据包,即将应用程序或服务产生的需要发送至上位机的数据包全部发送至上位机,此时数据设备进入休眠状态。由于数据设备进入休眠状态时数据发送队列中不存在滞留数据包,因此在数据设备退出低功耗模式重新进入工作状态时,上位机不会接收到数据设备进入休眠状态前的不完整的滞留数据包,保证了数据设备与上位机之间的数据链路正常。由此可见,本申请提供的数据处理方法,提高了数据设备进入 和退出低功耗模式的健壮性和稳定性。本申请还公开了一种数据处理装置及一种电子设备和一种计算机可读存储介质,同样能实现上述技术效果。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本申请。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。附图是用来提供对本公开的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本公开,但并不构成对本公开的限制。在附图中:
图1为根据一示例性实施例示出的一种数据处理方法的流程图;
图2为根据一示例性实施例示出的另一种数据处理方法的流程图;
图3为根据一示例性实施例示出的一种USB数据设备进入休眠状态的流程图;
图4为根据一示例性实施例示出的一种数据处理装置的结构图;
图5为根据一示例性实施例示出的一种电子设备的结构图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。另外,在本申请实施例中,“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本申请实施例公开了一种数据处理方法,提高了数据设备进入和退出 低功耗模式的健壮性和稳定性。
参见图1,根据一示例性实施例示出的一种数据处理方法的流程图,如图1所示,包括:
S101:接收休眠指令,判断数据发送队列中是否存在滞留数据包;其中,所述滞留数据包为待发送至所述上位机的数据包;若是,则进入S102;
本实施例的执行主体为用于实现特定应用程序或服务的数据设备,此处的数据设备可以具体为USB(中文全称:通用串行总线,英文全称:Universal Serial Bus)数据设备,即该数据设备通过USB接口与上位机连接,当然,此处的数据设备还可以包括其他类型的数据设备,即数据设备通过其他接口与上位机连接,本实施例不进行具体限定。
在具体实施中,当数据设备接收到休眠指令时,准备进入低功耗模式即休眠状态。可以理解的是,此处的休眠指令可以是上位机发送至数据设备的,也可以是其他设备发送至数据设备的,本实施例不进行具体限定。作为一种可行的实施方式,所述接收休眠指令,包括:接收目标中断消息,所述目标中断消息用于指示所述数据设备进入休眠状态。在具体实施中,上位机或其他设备可以以中断的方式控制数据设备进入休眠状态,即上位机或其他设备向数据设备发送用于指示进入休眠状态的目标中断消息。
可以理解的是,数据设备在工作状态下,应用程序或服务产生需要发送至上位机的数据包,将其加入数据发送队列中,进而传输至上位机。在本步骤中,在数据设备进入休眠状态前,数据设备判断数据发送队列中是否存在待发送至上位机的滞留数据包,若是,则进入S102,若否,则数据设备直接进入休眠状态。
S102:将所述数据发送队列中的数据包发送至所述上位机,以减少所述滞留数据包的数量;
S103:在所述数据发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
在具体实施中,若数据设备的数据发送队列中存在待发送至上位机的滞留数据包,则将数据发送队列中的数据包发送至上位机。随着数据发送队列中的数据包陆续发送至上位机,滞留数据包数量减少,在数据发送队 列中的数据包全部发送完成后,实现了清除滞留数据包的目的,即实现了将应用程序或服务产生的需要发送至上位机的数据包全部发送至上位机的目的,此时数据设备进入休眠状态,数据发送队列中不存在滞留数据包,在数据设备退出低功耗模式重新进入工作状态时,不会接收到不完整的滞留数据包,不会导致数据链路异常。
本申请实施例提供的数据处理方法,在数据设备进入休眠状态前,数据设备判断数据发送队列中是否存在待发送至上位机的滞留数据包,若是,则将数据发送队列中的数据包发送至上位机。在数据发送队列中的数据包全部发送完成后,清除了滞留数据包,即将应用程序或服务产生的需要发送至上位机的数据包全部发送至上位机,此时数据设备进入休眠状态。由于数据设备进入休眠状态时数据发送队列中不存在滞留数据包,因此在数据设备退出低功耗模式重新进入工作状态时,上位机不会接收到数据设备进入休眠状态前的不完整的滞留数据包,保证了数据设备与上位机之间的数据链路正常。由此可见,本申请实施例提供的数据处理方法,提高了数据设备进入和退出低功耗模式的健壮性和稳定性。
本申请实施例公开了一种数据处理方法,相对于上一实施例,本实施例对技术方案作了进一步的说明和优化。具体的:
参见图2,根据一示例性实施例示出的另一种数据处理方法的流程图,如图2所示,包括:
S201:通过所述物理层接收休眠指令,判断所述链路层对应的队列中是否存在滞留数据包;其中,所述滞留数据包为待发送至所述上位机的数据包;若是,则进入S202;
本实施例的执行主体同样为用于实现特定应用程序或服务的数据设备,该数据设备包括应用层、链路层和物理层,应用层为上层的应用程序或服务,物理层是指具体的USB控制器和物理连接,该数据设备通过物理层与上位机连接,而链路层是为了屏蔽物理层的差异而引入的中间层,起到承上启下的作用。
数据设备采用3级软件队列,即应用层、链路层和物理层分别对应于 一个队列,数据设备向上位机传输数据的流程为:应用程序或服务产生需要发送至上位机的数据包,将其加入应用层对应的队列中,依次经过链路层对应的队列、物理层发送数据端点对应的发送队列即硬件FIFO(中文全称:先进先出,英文全称:First Input First Output)发送至上位机。在本实施例中,数据设备通过物理层接收休眠指令,判断链路层对应的队列中是否存在待发送至上位机的滞留数据,若是,则进入S202,若否,则数据设备直接进入休眠状态。
作为一种优选实施方式,所述通过所述物理层接收休眠指令之后,还包括:停止向所述应用层对应的队列中添加数据。在具体实施中,物理层接收到休眠指令,通知应用层,应用层中的应用程序或服务停止产生需要发送至上位机的数据,即停止向应用层对应的队列中添加数据,避免继续在链路层对应的队列中产生滞留数据包。
S202:将所述物理层对应的发送队列中的数据包发送至所述上位机,以减少所述滞留数据的数量;
S203:在所述物理层对应的发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
在具体实施中,若链路层对应的队列中存在待发送至上位机的滞留数据包,则将物理层对应的发送队列中的数据包发送至上位机,此时物理层对应的发送队列存在空余空间,链路层对应的队列中的滞留数据包流入物理层对应的发送队列,继续发送至上位机。也即,随着物理层对应的发送队列中的数据包发送至上位机,链路层对应的队列中的滞留数据包的数量也减少。在链路层对应的队列中的滞留数据包全部流入物理层对应的发送队列并发送至上位机后,数据设备进入休眠状态。
在本实施例的基础上,作为一种优选实施方式,将所述物理层对应的发送队列中的数据包发送至所述上位机之后,还包括:向所述应用层发送通知消息,以清除所述应用层对应的队列中发送完成的数据包,并更新所述应用层对应的队列的数据包数量。在具体实施中,物理层对应的发送队列中一个数据包成功发送至上位机后,通过链路层通知应用层,应用层删除对应的队列中的该数据包,并将应用层对应的队列的数据包数量减一。 当应用层对应的队列的数据包数量为零时,应用层释放对应的队列。
由此可见,本实施例在数据设备进入休眠状态前,清除链路层对应的队列中的滞留数据包,由于数据设备进入休眠状态时链路层对应的队列中不存在滞留数据包,因此在数据设备退出低功耗模式重新进入工作状态时,上位机不会接收到链路层的不完整的滞留数据包,保证了数据设备与上位机之间的数据链路正常。由此可见,本申请实施例提供的数据处理方法,提高了数据设备进入和退出低功耗模式的健壮性和稳定性。
下面介绍本申请提供的一种应用实施例,执行主体为USB数据设备,该USB数据设备包括USB物理层、USB链路层和应用层,其进入休眠状态的流程如图3所示,具体的:
USB物理层接收休眠中断,通过USB链路层通知应用层,应用层设置休眠标记,停止向对应的队列中添加数据,并判断USB链路层对应的队列中是否存在正在发送的数据。若USB链路层对应的队列中存在正在发送的数据,则将物理层对应的发送队列中的数据包发送至上位机,通过USB链路层通知应用层该数据包发送完成,应用层丢弃对应队列中的该数据包,将对应队列的数据包数量减一。物理层对应的发送队列存在空余空间时,USB链路层对应的队列中的数据流入物理层对应的发送队列,继续发送至上位机。应用层对应的队列的数据包数量清零时,响应休眠事件,进入休眠状态。若USB链路层对应的队列中不存在正在发送的数据,则USB数据设备直接进入休眠状态。
下面对本申请实施例提供的一种数据处理装置进行介绍,下文描述的一种数据处理装置与上文描述的一种数据处理方法可以相互参照。
参见图4根据一示例性实施例示出的一种数据处理装置的结构图,如图4所示,包括:
判断模块401,用于接收休眠指令,判断数据发送队列中是否存在滞留数据包;其中,所述滞留数据包为待发送至所述上位机的数据包;若是,则启动发送模块402的工作流程;
所述发送模块402,用于将所述数据发送队列中的数据包发送至所述上位机,以减少所述滞留数据包的数量;
第一控制模块403,用于在所述数据发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
本申请实施例提供的数据处理装置,在数据设备进入休眠状态前,数据设备判断数据发送队列中是否存在待发送至上位机的滞留数据包,若是,则将数据发送队列中的数据包发送至上位机。在数据发送队列中的数据包全部发送完成后,清除了滞留数据包,即将应用程序或服务产生的需要发送至上位机的数据包全部发送至上位机,此时数据设备进入休眠状态。由于数据设备进入休眠状态时数据发送队列中不存在滞留数据包,因此在数据设备退出低功耗模式重新进入工作状态时,上位机不会接收到数据设备进入休眠状态前的不完整的滞留数据包,保证了数据设备与上位机之间的数据链路正常。由此可见,本申请实施例提供的数据处理装置,提高了数据设备进入和退出低功耗模式的健壮性和稳定性。
在上述实施例的基础上,作为一种优选实施方式,所述数据设备包括应用层、链路层和物理层,所述物理层与上位机连接;
相应的,所述判断模块401具体为通过所述物理层接收休眠指令,判断所述链路层对应的队列中是否存在滞留数据包的模块;
相应的,所述发送模块402具体为将所述物理层对应的发送队列中的数据包发送至所述上位机,以减少所述滞留数据包的数量的模块;
相应的,所述第一控制模块403具体为在所述物理层对应的发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态的模块。
在上述实施例的基础上,作为一种优选实施方式,还包括:
第二控制模块,用于通过所述物理层接收休眠指令之后,控制所述应用层停止向对应的队列中添加数据包。
在上述实施例的基础上,作为一种优选实施方式,还包括:
更新模块,用于向所述应用层发送通知消息,以清除所述应用层对应的队列中发送完成的数据包,并更新所述应用层对应的队列的数据包数量。
在上述实施例的基础上,作为一种优选实施方式,还包括:
第三控制模块,用于当所述应用层对应的队列的数据包数量为零时,控制所述应用层释放对应的队列。
在上述实施例的基础上,作为一种优选实施方式,所述判断模块401包括:
接收单元,用于接收目标中断消息,所述目标中断消息用于指示所述数据设备进入休眠状态;
判断单元,用于判断数据发送队列中是否存在滞留数据包。
在上述实施例的基础上,作为一种优选实施方式,所述数据设备具体为USB数据设备。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
基于上述程序模块的硬件实现,且为了实现本申请实施例的方法,本申请实施例还提供了一种电子设备,该电子设备具体可以为能够实现上述数据处理功能的模组或包含该模组的终端设备等,终端设备具体可以为移动终端和/或智能设备等,移动终端具体可以为手机、平板电脑、笔记本电脑等中的至少一种,能够实现上述数据处理功能的模组具体可以为2G通信模组、3G通信模组、4G通信模组、5G通信模组、NB-IOT(中文全称:窄带物联网,英文全称:Narrow Band Internet of Things)通信模组等中任意一种。
请参见图5,图5为根据一示例性实施例示出的一种电子设备的结构图,如图5所示,电子设备包括:
通信接口1,能够与其它设备比如网络设备等进行信息交互;
处理器2,与通信接口1连接,以实现与其它设备进行信息交互,用于运行计算机程序时,执行上述一个或多个技术方案提供的数据处理方法。而所述计算机程序存储在存储器3上。
当然,实际应用时,电子设备中的各个组件通过总线系统4耦合在一起。可理解,总线系统4用于实现这些组件之间的连接通信。总线系统4 除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图5中将各种总线都标为总线系统4。
本申请实施例中的存储器3用于存储各种类型的数据以支持电子设备的操作。这些数据的示例包括:用于在电子设备上操作的任何计算机程序。
可以理解,存储器3可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random Access Memory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本申请实施例描述的存储器2旨在包括但不限于这些和任意其它适合类型的存储器。
上述本申请实施例揭示的方法可以应用于处理器2中,或者由处理器2实现。处理器2可能是一种集成电路芯片,具有信号的处理能力。在实 现过程中,上述方法的各步骤可以通过处理器2中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器2可以是通用处理器、DSP,或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器2可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器3,处理器2读取存储器3中的程序,结合其硬件完成前述方法的步骤。
处理器2执行所述程序时实现本申请实施例的各个方法中的相应流程,为了简洁,在此不再赘述。
在示例性实施例中,本申请实施例还提供了一种存储介质,即计算机存储介质,具体为计算机可读存储介质,例如包括存储计算机程序的存储器3,上述计算机程序可由处理器2执行,以完成前述方法所述步骤。计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
或者,本申请上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台电子设备(可以是个人计算机、服务器、或者网络设备等)执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (10)

  1. 一种数据处理方法,其特征在于,应用于数据设备,所述数据设备与上位机连接,所述方法包括:
    接收休眠指令,判断数据发送队列中是否存在滞留数据包;其中,所述滞留数据包为待发送至所述上位机的数据包;
    若是,则将所述数据发送队列中的数据包发送至所述上位机,以减少所述滞留数据包的数量;
    在所述数据发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
  2. 根据权利要求1所述数据处理方法,其特征在于,所述数据设备包括应用层、链路层和物理层,所述物理层与上位机连接;
    相应的,所述接收休眠指令,判断数据发送队列中是否存在滞留数据包,包括:
    通过所述物理层接收休眠指令,判断所述链路层对应的队列中是否存在滞留数据包;
    相应的,将所述数据发送队列中的数据包发送至所述上位机,包括:
    将所述物理层对应的发送队列中的数据包发送至所述上位机;
    相应的,在所述数据发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态,包括:
    在所述物理层对应的发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
  3. 根据权利要求2所述数据处理方法,其特征在于,所述通过所述物理层接收休眠指令之后,还包括:
    控制所述应用层停止向对应的队列中添加数据包。
  4. 根据权利要求2所述数据处理方法,其特征在于,将所述物理层对应的发送队列中的数据包发送至所述上位机之后,还包括:
    向所述应用层发送通知消息,以清除所述应用层对应的队列中发送完成的数据包,并更新所述应用层对应的队列的数据包数量。
  5. 根据权利要求4所述数据处理方法,其特征在于,所述更新所述应 用层对应的队列的数据包数量之后,还包括:
    若所述应用层对应的队列的数据包数量为零,则控制所述应用层释放对应的队列。
  6. 根据权利要求1所述数据处理方法,其特征在于,所述接收休眠指令,包括:
    接收目标中断消息,所述目标中断消息用于指示所述数据设备进入休眠状态。
  7. 根据权利要求1所述数据处理方法,其特征在于,所述数据设备具体为USB数据设备。
  8. 一种数据处理装置,其特征在于,应用于数据设备,所述数据设备与上位机连接,所述装置包括:
    判断模块,用于接收休眠指令,判断数据发送队列中是否存在滞留数据包;其中,所述滞留数据包为待发送至所述上位机的数据包;若是,则启动发送模块的工作流程;
    所述发送模块,用于将所述数据发送队列中的数据包发送至所述上位机,以减少所述滞留数据包的数量;
    第一控制模块,用于在所述数据发送队列中的数据包全部发送完成后,控制所述数据设备进入休眠状态。
  9. 一种电子设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述数据处理方法的步骤。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述数据处理方法的步骤。
PCT/CN2021/129521 2021-04-07 2021-11-09 一种数据处理方法、装置及电子设备和存储介质 WO2022213598A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110372152.4A CN113051207A (zh) 2021-04-07 2021-04-07 一种数据处理方法、装置及电子设备和存储介质
CN202110372152.4 2021-04-07

Publications (1)

Publication Number Publication Date
WO2022213598A1 true WO2022213598A1 (zh) 2022-10-13

Family

ID=76518820

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/129521 WO2022213598A1 (zh) 2021-04-07 2021-11-09 一种数据处理方法、装置及电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN113051207A (zh)
WO (1) WO2022213598A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051207A (zh) * 2021-04-07 2021-06-29 深圳市广和通无线股份有限公司 一种数据处理方法、装置及电子设备和存储介质
CN114327304A (zh) * 2021-12-14 2022-04-12 珠海奔图电子有限公司 一种数据处理方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106685855A (zh) * 2017-01-17 2017-05-17 新智数字科技有限公司 一种数据发送方法及装置
CN108737119A (zh) * 2017-04-21 2018-11-02 中国移动通信有限公司研究院 一种数据传输方法、装置及系统
US20200348968A1 (en) * 2019-05-03 2020-11-05 Servicenow, Inc. Active queue management in a multi-node computing environment
CN113051207A (zh) * 2021-04-07 2021-06-29 深圳市广和通无线股份有限公司 一种数据处理方法、装置及电子设备和存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105491651B (zh) * 2016-01-05 2019-04-02 上海建工集团股份有限公司 上位机实现节点休眠唤醒自动控制方法及系统
US10659376B2 (en) * 2017-05-18 2020-05-19 International Business Machines Corporation Throttling backbone computing regarding completion operations
CN109743717B (zh) * 2019-03-06 2021-11-30 深圳市飞比电子科技有限公司 数据处理方法、装置、终端设备及存储介质
CN112162900A (zh) * 2020-09-18 2021-01-01 北京浪潮数据技术有限公司 一种硬件信息采集方法、装置及电子设备和存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106685855A (zh) * 2017-01-17 2017-05-17 新智数字科技有限公司 一种数据发送方法及装置
CN108737119A (zh) * 2017-04-21 2018-11-02 中国移动通信有限公司研究院 一种数据传输方法、装置及系统
US20200348968A1 (en) * 2019-05-03 2020-11-05 Servicenow, Inc. Active queue management in a multi-node computing environment
CN113051207A (zh) * 2021-04-07 2021-06-29 深圳市广和通无线股份有限公司 一种数据处理方法、装置及电子设备和存储介质

Also Published As

Publication number Publication date
CN113051207A (zh) 2021-06-29

Similar Documents

Publication Publication Date Title
WO2022213598A1 (zh) 一种数据处理方法、装置及电子设备和存储介质
US11106474B2 (en) System, method, and apparatus for DVSEC for efficient peripheral management
RU2633126C2 (ru) Усиление механизма перечисления и/или конфигурации одного протокола межсоединений для другого протокола межсоединений
US9740645B2 (en) Reducing latency in a peripheral component interconnect express link
US8863109B2 (en) Updating secure pre-boot firmware in a computing system in real-time
WO2018040494A1 (zh) 一种扩展处理器指令集的方法及装置
JP2008090375A (ja) 割込み制御システム、およびこれを利用した記憶制御システム
KR20140132386A (ko) 감소된 지연을 갖는 원격 직접 메모리 액세스
EP3360044B1 (en) System and method for providing operating system independent error control in a computing device
EP1449097B1 (en) Aggregation of hardware events in multi-node systems
US10140221B2 (en) Method to handle host, device, and link's latency tolerant requirements over USB Type-C power delivery using vendor defined messaging for all alternate modes
JP2006351013A (ja) 電子装置において保存/リストア手順を行なうための方法及びシステム
US9377966B2 (en) Method and apparatus for efficiently processing storage commands
WO2013109233A2 (en) Method to emulate message signaled interrupts with interrupt data
CN105556461A (zh) 用于预os镜像重写以提供跨架构支持、安全性自省和性能优化的技术
US20230342086A1 (en) Data processing apparatus and method, and related device
TWI502361B (zh) 加速信息發信中斷處理的處理器、方法及系統
JP6954864B2 (ja) 半導体装置およびufsシステム
WO2020082354A1 (zh) 一种系统状态检测方法、系统状态装置及终端设备
US11606316B2 (en) System and method for modem stabilization when waiting for AP-driven link recovery
WO2024093491A1 (zh) 一种性能调控方法及电子设备
JP2006040063A (ja) 情報処理装置および情報処理装置のsmi処理方法
CN110489359B (zh) 一种数据传输控制方法及系统
GB2610256A (en) Data processing method and electronic device
TW498218B (en) Method and apparatus for providing real-time operation in a personal computer system

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: 21935816

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: 21935816

Country of ref document: EP

Kind code of ref document: A1