CN111858084B - Data transmission method and device, electronic equipment and storage medium - Google Patents

Data transmission method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111858084B
CN111858084B CN202010489483.1A CN202010489483A CN111858084B CN 111858084 B CN111858084 B CN 111858084B CN 202010489483 A CN202010489483 A CN 202010489483A CN 111858084 B CN111858084 B CN 111858084B
Authority
CN
China
Prior art keywords
data
target
target data
preset
service thread
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.)
Active
Application number
CN202010489483.1A
Other languages
Chinese (zh)
Other versions
CN111858084A (en
Inventor
王亚萌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Dingsheng Photoelectric Co ltd
Original Assignee
Shenzhen Dingsheng Photoelectric Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Dingsheng Photoelectric Co ltd filed Critical Shenzhen Dingsheng Photoelectric Co ltd
Priority to CN202010489483.1A priority Critical patent/CN111858084B/en
Publication of CN111858084A publication Critical patent/CN111858084A/en
Application granted granted Critical
Publication of CN111858084B publication Critical patent/CN111858084B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/542Event management; Broadcasting; Multicasting; Notifications
    • 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

Abstract

The application provides a data sending method, a data sending device, electronic equipment and a storage medium, which are suitable for the technical field of communication and can effectively send target data to target equipment completely without delay. The method is suitable for the electronic equipment, an operating system based on a linux kernel is preconfigured on the electronic equipment, and the method comprises the following steps: monitoring a preset event for sending target data to target equipment; when the preset event is monitored, locking a cache resource from the operating system through a preset service thread in the linux kernel; the cache resource is used for caching target data corresponding to the preset event; and sending the target data to the target equipment through the preset service thread.

Description

Data transmission method and device, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of communication, and particularly relates to a data transmission method, a data transmission device, electronic equipment and a storage medium.
Background
In the existing data transmission technology, in order to send target data from a transmitting end to a receiving end, a specific modulation mode is adopted to modulate the target data and then transmit the target data to the receiving end. The modulated target data adopts waveforms such as sine waves or square waves in the same period to distinguish the bit 1 from the bit 0, specifically, different Duty ratios (Duty Ratio) in the same period are used to distinguish the bit 1 from the bit 0, and the Duty Ratio refers to the proportion of high level in one period. For example, in an actual application scenario of an infrared remote controller, in order to send target data corresponding to a key to a target device, processing from an electrical signal of the key to an infrared signal is generally implemented based on application layer control of a single-chip microcomputer or an operating system, so that the target data corresponding to the key is modulated into an infrared signal with a specific waveform and sent to the target device.
However, when transmitting the target data based on the existing data transmission method, the operation of transmitting the target data is often forced to be interrupted due to an emergency, which results in abnormal or failed transmission of the target data, and thus the data transmission effect is poor. For example, when an application layer based on an android system transmits infrared signal data, the application layer is often scheduled for a system kernel, so that the operation of transmitting the infrared signal data is forced to be interrupted, and the waveform of the transmitted infrared signal data is abnormal, thereby causing failure in transmitting the infrared signal data. Therefore, the existing data transmission method cannot better ensure that the target data transmission operation is continuously performed until the target data transmission operation is finished, so that the waveform of the transmitted target data is abnormal, and the data transmission effect is poor.
Disclosure of Invention
The embodiment of the application provides a data transmission method, a device, electronic equipment and a storage medium, which are used for solving the problems that in the data transmission process, the operation of target data transmission is always forced to be interrupted due to an emergency, so that the target data transmission is abnormal or fails, and the data transmission effect is poor.
In a first aspect, an embodiment of the present application provides a data sending method, which is applicable to an electronic device, where an operating system based on a linux kernel is preconfigured on the electronic device, and the method includes:
monitoring a preset event for sending target data to target equipment;
when the preset event is monitored, locking a cache resource from the operating system through a preset service thread in the linux kernel; the cache resource is used for caching target data corresponding to the preset event;
and sending the target data to the target equipment through the preset service thread.
By adopting the data transmission method provided by the application, after the preset event for transmitting the target data to the target device is monitored through the operating system, the cache resource can be locked from the operating system based on the preset service thread in the linux kernel call kernel of the operating system so that the target data can be better stored, and meanwhile, under the control of the non-real-time scheduling strategy FiFo provided by the linux kernel, the target data is acquired from the cache resource by the preset service thread and is transmitted to the target device, so that the situation that the target data transmission operation is forced to be interrupted due to an emergency can be effectively avoided, and the target data can be effectively transmitted to the target device completely without delay.
In a second aspect, an embodiment of the present application provides a data sending device, where an operating system based on a linux kernel is preconfigured on the data sending device, and the device includes:
the monitoring module is used for monitoring a preset event for sending target data to target equipment;
the locking module is used for locking cache resources from the operating system through a preset service thread in the linux kernel when the preset event is monitored; the cache resource is used for caching target data corresponding to the preset event;
and the sending module is used for sending the target data to the target equipment through the preset service thread.
In a third aspect, an embodiment of the present application provides an electronic device, including: the data transmission system comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the data transmission method when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, comprising: the computer readable storage medium stores a computer program which, when executed by a processor, implements the data transmission method.
In a fifth aspect, embodiments of the present application provide a computer program product, which when run on an electronic device, causes the electronic device to perform the data transmission method of any one of the first aspects above.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required for the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a data transmission method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In order to illustrate the technical solutions described in the present application, the following description is made by specific examples.
The data sending method provided by the embodiment of the application can be applied to electronic devices such as remote controllers, mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (augmented reality, AR)/Virtual Reality (VR) devices, notebook computers, ultra-mobile personal computer (UMPC), netbooks, personal digital assistants (personal digital assistant, PDA) and the like, and the specific types of the electronic devices are not limited.
For example, the electronic device may be a Station (ST) in a Wlan, but may also be a cellular telephone, a cordless telephone, a Session initiation protocol (Session InitiationProtocol, SIP) telephone, a wireless local loop (Wireless Local Loop, WLL) station, a personal digital assistant (Personal Digital Assistant, PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a car networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite radio, a wireless modem card, a television Set Top Box (STB), a customer premise equipment (customer premise equipment, CPE) and/or other devices for communicating over a wireless system, as well as next generation communication systems, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved public land mobile network (Public Land Mobile Network, PLMN) network, etc.
Referring to fig. 1, fig. 1 is a flowchart of a data transmission method according to an embodiment of the present application. The execution main body of the data transmission method in this embodiment is an electronic device, an operating system based on a linux kernel is preconfigured on the electronic device, and a transmission component is further arranged on the electronic device for driving and controlling the operating system to transmit target data. As shown in fig. 1, the data transmission method of the present application may include:
s101: and monitoring a preset event for sending target data to the target device.
In step S101, the target device is a device controlled to operate by the electronic device.
The target data is data information which is formed by the electronic equipment according to the preset event and used for controlling the operation of the target equipment.
The target device can execute a preset operation action according to the received target data. For example, when the electronic device monitors the preset event, the electronic device sends target data for controlling the target device to stop running to the target device, and the target device can execute an action for stopping the running of the target device according to the target data.
The preset event is an operation event used for describing that a user triggers on the electronic equipment to send the target data to the target equipment.
Based on an application layer of a pre-configured operating system in the electronic equipment, receiving a trigger event input by the electronic equipment in real time, matching the trigger event with a preset event, if the matching is successful, determining that the preset event for sending to the target equipment exists, and acquiring target data according to the preset event.
For example, when the preset event is an infrared event, the electronic device is an infrared remote controller, and the target device is an intelligent television. And the infrared remote controller is preconfigured with an android operating system, and whether a key code sent by a keyboard controller of the infrared remote controller is received or not is monitored in real time based on an application layer of the android operating system. If the key code is received, the key code is matched with a preset key code, if the key code is successfully matched, the existence of the infrared event is determined, target data to be transmitted is obtained through conversion according to the key code, for example, code value data is obtained through conversion, and the code value data is target data transmitted to the intelligent television by the infrared remote controller, for example, shutdown data corresponding to a shutdown key code.
In an example, the preset event is any event in a preset event list, that is, based on whether a trigger event exists in an application layer of a preconfigured operating system in the electronic device, if the trigger event exists, the trigger event is matched with the preset event recorded in the preset event list, and if the matching is successful, it is determined that the preset event list for sending target data to the target device is monitored.
In an example, based on an application layer of an operating system preconfigured in the electronic device, periodically reading a trigger event record list one by one, matching the read trigger event with the preset event, and determining that the preset event for sending to the target device exists if the matching is successful.
S102: when the preset event is monitored, locking a cache resource from the operating system through a preset service thread in the linux kernel; the cache resource is used for caching target data corresponding to the preset event.
In step S102, the preset service thread is a kernel thread in the linux kernel. The cache resource is a memory in the electronic device for temporarily storing programs and data, and can be managed and configured by the operating system. The operating system is a computer program that manages computer hardware and software resources in the electronic device.
The operating system is divided into four layers, namely an application program layer, an application framework layer (FWK), a system running layer and the linux kernel layer, and the layers are communicated through software interfaces.
The application layer may be a series of application packages, and the application packages may include one or more of short messages, calendars, cameras, videos, navigation, communication, keyboards, and other application programs.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer may include some predefined functions, for example, functions for receiving events sent by the application framework layer.
The application framework layer includes one or more of a view system, a content provider, a resource manager, a notification manager, and an activity manager.
The view system comprises visual controls, such as a control for displaying characters, a control for displaying pictures and the like. The view system may be used to build an application such that a display interface of the electronic device may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying a picture, and may include a display interface including a keyboard icon.
The content provider (Content Providers) allows applications to access data of another application (e.g., a contact database) or share their own data
The Resource Manager (Resource Manager) provides access to non-code resources such as local strings, graphics and Layout files (Layout files).
The notification manager (Notification Manager) enables an application to display custom hints in a status bar of the electronic device.
The Activity Manager (Activity Manager) is used to manage application lifecycle and provide common navigation rollback functionality.
The system layer may include a plurality of functional modules. For example: sensor service module, physical state recognition module, three-dimensional graphics processing library (e.g. OpenGL ES), etc.
The sensor service module is used for monitoring sensor data uploaded by various sensors of the hardware layer and determining the physical state of the electronic equipment.
The physical state recognition module is used for analyzing and recognizing gestures, faces and the like of a user;
the three-dimensional graphic processing library can be used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
In an example, the system layer may further include: the surface manager is used to manage the display subsystem and provides a seamless fusion of 2D and 3D layers for multiple applications.
The linux kernel is a layer between hardware and software, and comprises one or more of a display driver, a sending component driver, a flash memory driver, a keyboard driver, power management, a kernel driver, an audio driver, a wireless driver and a camera driver, and is used for driving related hardware of a hardware layer of the electronic device, such as a display screen, an infrared transmitting tube, a sensor and the like.
S103: and sending the target data to the target equipment through the preset service thread.
In this embodiment, when the preset event is monitored, the preset event and corresponding target data are sent to the linux kernel through an application layer of the operating system, and when the linux kernel receives the preset event, the preset service thread is started through the linux kernel, and further, a cache resource is locked from the operating system through the preset service thread according to the size of the target data, so that the target data are waited to be cached to the cache resource continuously. And the locking time of the cache resource is from the locking of the operating system to the complete sending of the target data to the target device by the preset service thread.
In order that the preset service thread can run continuously without being interrupted by a scheduler of the operating system, the target data can be sent to the target device completely and without delay, the priority of the preset service thread is the highest priority, and the scheduling policy is set to be a non-real-time scheduling policy (FiFo).
The target data is code value data corresponding to a key code of the infrared remote controller. When an infrared event is monitored, the infrared event and code value data corresponding to the infrared event are sent to a linux kernel through an application layer of the operating system.
When the infrared event received by the linux kernel is detected, the preset service thread is started, a cache resource is locked from the operating system through the preset service thread according to the size of the code value data, if the size of the code value data is 4 bytes, the cache resource with the size of 4 bytes is locked from the operating system, and the code value data is waited to be cached in the cache resource.
And when confirming that the code value data exist in the cache resource, transmitting the code value data to the target equipment through the preset service thread.
In an example, when the target data is completely cached in the cache resource, reading the target data from the cache resource by the preset service thread, sending the target data to the target device, and releasing the locked cache resource after sending the target data to the target device.
In an example, when the target data transmission is finished, the preset service thread enters a sleep state.
In an example, the target data is continuously read from the cache resource through the preset service thread, an electric signal is generated according to the target data control, and meanwhile, a sending component on the electronic equipment is called, and the target data is sent to the target equipment based on the electric signal.
For example, the preset service thread continuously reads the code value data corresponding to the infrared event from the cache resource, and generates an electric signal according to the code value data control, and meanwhile invokes an infrared transmitting tube on the electronic device to transmit an optical signal to the target device based on the electric signal, so that the code value data is transmitted to the target device, for example, the optical signal is transmitted to the smart television.
Specifically, the target data includes an address code, a command code and a command code, wherein the address code and the command code are first phase data, and the address code and the command code are second phase data.
Specifically, when the target data is continuously read from the cache resource through the preset service thread, the address code and the command code are identified as first phase data, the address counter code and the command counter code are identified as second phase data, and the first phase data and the second phase data are utilized to generate the electric signal; wherein a high level of the electrical signal is used to describe the first phase data and a low level of the electrical signal is used to describe the second phase data.
And controlling and generating a high-low level signal according to the first phase data and the second phase data in the target data through the preset service thread, and driving the sending component to run so as to send the target data to the target equipment.
The order of the target data is exemplified by an address code, a command code, and is represented by 0 or 1, the first phase data is represented by 1, and the second phase data is represented by 0. For example, the address code is 11111111, the address code is 000000, the command code is 11111111, and the command code is 000000.
And the preset service thread generates high-low level signals according to the sequence control of the constituting data in the target data. When an address code or a command code is transmitted, the preset service thread drives the gpio port to set a high level, keep the high level for 0.56ms, and keep the low level for 1.68ms because of being indicated by 1, so that a data waveform corresponding to the address code or the command code is obtained through modulation, the modulated corresponding data waveform is transmitted to target equipment through a transmitting component which is arranged on the electronic equipment and is connected with an output port (gpio port), and then the target equipment analyzes target data according to the received data waveform. Or when the address code or the command code is sent, the preset service thread drives the gpio port to set high level and keep 0.56ms and low level for 0.56ms because of being expressed by 0, so that the data waveform corresponding to the address code or the command code is modulated and obtained, the modulated corresponding data waveform is sent to the target equipment through a sending component which is arranged on the electronic equipment and connected with an output port (gpio port), and then the target equipment analyzes the target data according to the received data waveform.
In an example, the sending component is an infrared sending tube, and the preset service thread is used for controlling to generate a high-low level signal according to the first phase data and the second phase data in the target data, so that the operation of the infrared sending tube is driven, and a specific optical signal is formed and sent to the target device, so that the target data is sent to the target device.
In an example, in order to facilitate the target device to better recognize and receive the target data, the preset service thread controls to generate a high-low level signal according to the first phase data and the second phase data in the target data to drive the operation of the sending component, so that before the target data is sent to the target device, the preset service thread generates a guide high-low level signal according to a guide code with a first preset length to drive the operation of the sending component, and sends guide identification data to the target device. The pilot code is first phase data.
For example, the pilot code is 1111111111111. Before the target data is sent, the preset service thread sets a high level according to the guide code driving gpio port, keeps 9ms, sets the guide code driving gpio port to be low level again and keeps 4.5ms, so that a data waveform corresponding to the modulated guide code is sent to the target device through a sending component which is arranged on the electronic device and is connected with an output port (gpio port).
In an example, in order to facilitate the target device to better identify that the target device stops receiving the target data, the preset service thread generates a high-low level signal according to the first phase data and the second phase data in the target data to drive the operation of the sending component, so that after the target data is sent to the target device, the preset service thread generates a stop electric signal according to a stop code with a second preset length to drive the operation of the sending component, and sends stop identification data to the target device. The stop code is second phase data.
For example, the stop code is 0000. After all the target data are sent to the target device, the preset service thread sets a high level according to the stop code driving gpio, keeps the high level for 0.56ms and sets the high level to be low level, so that a data waveform corresponding to the modulated guide code is sent to the target device through a sending component which is arranged on the electronic device and is connected with an output port (gpio port).
In an example, the target data includes an address code, a command code, and a command code, wherein the address code, the command code, or the command code are each represented by first phase data and second phase data, respectively.
Generating the electrical signal using the first phase data and the second phase data; wherein a high level of the electrical signal is used to describe the first phase data and a low level of the electrical signal is used to describe the second phase data.
The order of the target data is exemplified by an address code, a command code, and is represented by 0 or 1, the first phase data is represented by 1, and the second phase data is represented by 0. For example, the address code is 11110000, the address code is 110000, the command code is 11111000, and the command code is 111000.
And the preset service thread generates high-low level signals according to the sequence control of the constituting data in the target data.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
Corresponding to the data transmission method described in the above embodiments, fig. 2 shows a block diagram of the data transmission apparatus provided in the embodiment of the present application, and for convenience of explanation, only the portions related to the embodiment of the present application are shown.
Referring to fig. 2, the apparatus includes:
the monitoring module is used for monitoring a preset event for sending target data to target equipment;
the locking module is used for locking cache resources from the operating system through a preset service thread in the linux kernel when the preset event is monitored; the cache resource is used for caching target data corresponding to the preset event;
and the sending module is used for sending the target data to the target equipment through the preset service thread.
Optionally, the monitoring module is further configured to send, when the preset event is monitored, the preset event to the linux kernel by an application layer of the operating system.
Optionally, the locking module includes a starting unit and a locking unit, where the starting unit is configured to enable the preset service thread when the linux kernel receives the preset event, and the locking unit is configured to lock, by the preset service thread, a cache resource from the operating system according to the size of the target data.
Optionally, the sending module is configured to generate an electrical signal according to the target data control by using the preset service thread, and drive, based on the electrical signal, a sending component provided on the electronic device to operate, so as to send the target data to the target device.
Optionally, the target data includes an address code, a command code and a command code, wherein the address code and the command code are first phase data, and the address code and the command code are second phase data; the electrical signal includes a high level signal corresponding to the first phase data and a low level signal corresponding to the second phase data.
The sending module is further configured to control, by the preset service thread according to the first phase data and the second phase data in the target data, to generate a high-low level signal to drive the sending component to operate, so as to send the target data to the target device.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 3, the electronic apparatus 3 of this embodiment includes: at least one processor 30 (only one processor is shown in fig. 3), a memory 31 and a computer program 32 stored in the memory 31 and executable on the at least one processor 30, the processor 30 implementing the steps in any of the various data transmission method embodiments described above when executing the computer program 32.
The electronic device 3 may be a remote control, a desktop computer, a notebook, a palm computer, etc. The electronic device may include, but is not limited to, a processor 30, a memory 31. It will be appreciated by those skilled in the art that fig. 3 is merely an example of the electronic device 3 and is not meant to be limiting of the electronic device 3, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The processor 30 may be a central processing unit (Central Processing Unit, CPU), the processor 30 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 31 may in some embodiments be an internal storage unit of the electronic device 3, such as a hard disk or a memory of the electronic device 3. The memory 31 may in other embodiments also be an external storage device of the electronic device 3, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the electronic device 3. The memory 31 is used for storing an operating system, application programs, boot loader (BootLoader), data, other programs etc., such as program codes of the computer program etc. The memory 31 may also be used for temporarily storing data that has been output or is to be output.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps that may implement the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on an electronic device, causes the electronic device to perform steps that may be performed in the various method embodiments described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a camera device/electronic apparatus, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (8)

1. The data transmission method is suitable for electronic equipment, and is characterized in that an operating system based on a linux kernel is preconfigured on the electronic equipment, and the method comprises the following steps:
monitoring a preset event for sending target data to target equipment;
when the preset event is monitored, locking a cache resource from the operating system through a preset service thread in the linux kernel; the cache resource is used for caching target data corresponding to the preset event;
sending the target data to the target device through the preset service thread, including: identifying the address code and the command code as first phase data, and identifying the address code and the command code as second phase data; generating an electrical signal using the first phase data and the second phase data; wherein a high level of the electrical signal is used to describe the first phase data and a low level of the electrical signal is used to describe the second phase data, the target data being transmitted to the target device based on the electrical signal.
2. The data transmission method according to claim 1, wherein when the preset event is monitored, locking, by a preset service thread in the linux kernel, a cache resource from the operating system includes:
when the preset event is monitored, the preset event is sent to the linux kernel through an application layer of the operating system;
enabling the preset service thread through the linux kernel;
and locking cache resources from the operating system according to the size of the target data through the preset service thread.
3. The data transmission method of claim 1, wherein the target data includes an address code, a command code, and a command code.
4. The data transmission method of claim 1, wherein the transmission component is an infrared transmitting tube;
invoking a transmitting component on the electronic device to transmit the target data to the target device based on the electrical signal, comprising:
and controlling and generating a high-low level signal according to the first phase data and the second phase data in the target data through the preset service thread, and driving the infrared transmitting tube to operate so as to send the target data to the target equipment.
5. The data transmission method as claimed in claim 1, wherein after the preset service thread transmits the target data to the target device, the method comprises:
and when the target data transmission is finished, the preset service thread enters a dormant state.
6. A data transmission apparatus, wherein an operating system based on a linux kernel is preconfigured on the data transmission apparatus, the apparatus comprising:
the monitoring module is used for monitoring a preset event for sending target data to target equipment;
the locking module is used for locking cache resources from the operating system through a preset service thread in the linux kernel when the preset event is monitored; the cache resource is used for caching target data corresponding to the preset event;
the sending module is configured to send the target data to the target device through the preset service thread, and includes: identifying the address code and the command code as first phase data, and identifying the address code and the command code as second phase data; generating an electrical signal using the first phase data and the second phase data; wherein a high level of the electrical signal is used to describe the first phase data and a low level of the electrical signal is used to describe the second phase data, the target data being transmitted to the target device based on the electrical signal.
7. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 5 when the computer program is executed.
8. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.
CN202010489483.1A 2020-06-02 2020-06-02 Data transmission method and device, electronic equipment and storage medium Active CN111858084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010489483.1A CN111858084B (en) 2020-06-02 2020-06-02 Data transmission method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010489483.1A CN111858084B (en) 2020-06-02 2020-06-02 Data transmission method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111858084A CN111858084A (en) 2020-10-30
CN111858084B true CN111858084B (en) 2023-07-25

Family

ID=72985831

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010489483.1A Active CN111858084B (en) 2020-06-02 2020-06-02 Data transmission method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111858084B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113395327B (en) * 2021-05-24 2023-07-04 深圳市元征科技股份有限公司 Data processing method, device, electronic equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101169758A (en) * 2007-11-19 2008-04-30 中兴通讯股份有限公司 Linux operation system course dispatching information monitoring method
CN104270854A (en) * 2014-09-16 2015-01-07 深圳市华海技术有限公司 Control method and terminal of multiple light-emitting devices
CN104951287A (en) * 2014-03-26 2015-09-30 可牛网络技术(北京)有限公司 Method and device for generating webpage
CN107229412A (en) * 2017-05-27 2017-10-03 深圳酷旗互联网有限公司 A kind of key control method and device of embedded Linux equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101169758A (en) * 2007-11-19 2008-04-30 中兴通讯股份有限公司 Linux operation system course dispatching information monitoring method
CN104951287A (en) * 2014-03-26 2015-09-30 可牛网络技术(北京)有限公司 Method and device for generating webpage
CN104270854A (en) * 2014-09-16 2015-01-07 深圳市华海技术有限公司 Control method and terminal of multiple light-emitting devices
CN107229412A (en) * 2017-05-27 2017-10-03 深圳酷旗互联网有限公司 A kind of key control method and device of embedded Linux equipment

Also Published As

Publication number Publication date
CN111858084A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
CN103425494A (en) Information interaction system of vehicle-mounted terminal and smart mobile terminal
CN112764817A (en) Equipment function awakening method and device
CN116382462B (en) Vibration method and vibration device
KR102137686B1 (en) Method for controlling an content integrity and an electronic device
CN111858084B (en) Data transmission method and device, electronic equipment and storage medium
US20120268650A1 (en) System and method for a thin-client terminal system using a serial bus
EP4095723B1 (en) Permission reuse method, permission reuse-based resource access method, and related device
CN115525453B (en) Multi-screen collaborative interrupt processing method and electronic equipment
CN108289165B (en) Method and device for realizing camera control based on mobile phone and terminal equipment
CN116233805B (en) File sharing method and electronic equipment
CN115776461A (en) Screen projection method, equipment and storage medium
CN112540839B (en) Information changing method, device, electronic equipment and storage medium
CN111736887B (en) Access system, method and device for utilizing old equipment and storage medium
CN110492935B (en) Data processing system, method and device and terminal equipment
CN107273082A (en) Display methods, device, terminal and the storage medium of image
CN114928580B (en) Data increment transmitting method, receiving method, terminal device and storage medium
CN111159734A (en) Communication terminal and multi-application data inter-access processing method
CN113268300B (en) Information display method and device
WO2022188750A1 (en) Application running method and electronic device
CN109857408A (en) Application dispositions method, device, equipment, system and the readable storage medium storing program for executing of terminal
CN112684878B (en) Data transmission method and electronic equipment
CN112116342B (en) Payment equipment communication method and device
CN111142648B (en) Data processing method and intelligent terminal
CN117076284B (en) Page loading time length detection method, equipment and storage medium
CN112181676B (en) Method, device, terminal equipment and readable storage medium for sharing recording data

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