CN111858084A - Data sending method and device, electronic equipment and storage medium - Google Patents
Data sending method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111858084A CN111858084A CN202010489483.1A CN202010489483A CN111858084A CN 111858084 A CN111858084 A CN 111858084A CN 202010489483 A CN202010489483 A CN 202010489483A CN 111858084 A CN111858084 A CN 111858084A
- Authority
- CN
- China
- Prior art keywords
- data
- target
- target data
- sending
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Selective Calling Equipment (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The application provides a data sending method, a data sending device, electronic equipment and a storage medium, which are applicable to the technical field of communication and can effectively send target data to target equipment in a complete and non-delayed manner. The method is suitable for electronic equipment, wherein an operating system based on a linux kernel is pre-configured on the electronic equipment, and the method comprises the following steps: monitoring a preset event for transmitting target data to target equipment; when the preset event is monitored, locking cache resources 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
Technical Field
The present application belongs to the field of communications technologies, and in particular, to a data transmission method, an apparatus, an electronic device, and a storage medium.
Background
In the existing data transmission technology, in order to transmit target data from a transmitting end to a receiving end, a specific modulation mode is often adopted to modulate the target data and transmit the modulated target data to the receiving end. The modulated target data may use waveforms such as sine waves or square waves with the same period to distinguish bit 1 and bit 0, specifically, bit 1 and bit 0 are distinguished by different duty ratios (DutyRatio) in the same period, where a duty ratio refers to a proportion of a high level in one period. For example, in an actual application scenario of the infrared remote controller, in order to send target data corresponding to a key to a target device, processing from a key electrical signal to an infrared light signal is generally implemented based on application layer control of a single chip or an operating system, so that the target data corresponding to the key is modulated into an infrared light signal with a specific waveform and sent to the target device.
However, when target data is transmitted based on the existing data transmission method, the operation of transmitting the target data is often forced to be interrupted due to an emergency, so that the target data is abnormally transmitted or failed, and the data transmission effect is poor. For example, when an application layer based on an android system sends infrared signal data, because the application layer often schedules a system kernel, an operation of sending the infrared signal data is forced to be interrupted, and a waveform of the sent infrared signal data is abnormal, so that the infrared signal data is failed to be sent. Therefore, the existing data transmission method cannot better ensure that the target data transmission operation continues to be completed, which often causes the waveform of the transmitted target data to be abnormal, resulting in poor data transmission effect.
Disclosure of Invention
The embodiment of the application provides a data sending method, a data sending device, electronic equipment and a storage medium, and aims to solve the problem that in the data sending process, the target data sending operation is frequently forced to be interrupted due to an emergency, so that the target data sending is abnormal or failed, and the data sending effect is poor.
In a first aspect, an embodiment of the present application provides a data sending method, which is applied 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 transmitting target data to target equipment;
when the preset event is monitored, locking cache resources 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 sending method provided by the application, after a preset event for sending the target data to the target equipment is monitored through the operating system, the preset service thread in the kernel can be called based on the linux kernel of the operating system to lock the cache resource from the operating system so as to better store the target data, and meanwhile, under the control of the non-real-time scheduling strategy FiFo provided by the linux kernel, the preset service thread obtains the target data from the cache resource and sends the target data to the target equipment, so that the situation that the sending operation of the target data is forced to be interrupted due to an emergency can be effectively avoided, and the target data can be effectively sent to the target equipment completely without delay.
In a second aspect, an embodiment of the present application provides a data sending apparatus, where an operating system based on a linux kernel is preconfigured on the data sending apparatus, and the apparatus includes:
The monitoring module is used for monitoring a preset event for sending target data to the 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: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the data transmission method when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including: the computer-readable storage medium stores a computer program which, when executed by a processor, implements the data transmission method.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when run on an electronic device, causes the electronic device to execute the data transmission method according to any one of the above first aspects.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a data transmission apparatus 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 structures, 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 contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this 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 present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
The data transmission method provided by the embodiment of the application can be applied to electronic devices such as a remote controller, a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and the like, and the embodiment of the application does not limit the specific type of the electronic device at all.
For example, the electronic device may be a Station (ST) in a Wlan, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capability, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a television Set Top Box (STB), a Customer Premises Equipment (CPE), and/or other devices for communicating over a wireless system and a next generation communication system, such as a Mobile terminal in a 5G Network or a Public Land Mobile Network (Public Land Mobile Network, PLMN) mobile terminals in the network, etc.
Referring to fig. 1, fig. 1 is a schematic flow chart of a data transmission method according to an embodiment of the present application. An execution main body of the data sending method in this embodiment is an electronic device, an operating system based on a linux kernel is configured on the electronic device in advance, and a sending component is further arranged on the electronic device and used for the operating system to drive and control sending of target data. As shown in fig. 1, the data transmission method of the present application may include:
s101: and monitoring a preset event for transmitting target data to the target equipment.
In step S101, the target device is a device controlled to operate by the electronic device.
And the target data is data information which is formed by the electronic equipment according to the preset event and is used for controlling the target equipment to operate.
The target device may perform a preset operation action according to the received target data. For example, when the electronic device monitors the preset event, target data for controlling the target device to stop operating is sent to the target device, and the target device may execute an action for stopping the operation of the target device according to the target data.
The preset event is an operation event used for describing that a user triggers the target data to be sent to the target device on the electronic device.
The method comprises the steps of receiving a trigger event input by electronic equipment in real time based on an application layer of an operating system configured in advance in the electronic equipment, matching the trigger event with a preset event, determining that the preset event used for sending to target equipment exists if matching is successful, and obtaining target data according to the preset event.
In an 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. An android operating system is pre-configured in the infrared remote controller, 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. And if the key code is received, matching the key code with a preset key code, if the key code is successfully matched, determining that the infrared event exists, converting the key code to obtain target data to be sent, if the key code is successfully matched, obtaining code value data, wherein the code value data is the target data sent to the intelligent television by the infrared remote controller, and if the key code is successfully matched, the code value data is shutdown data corresponding to a shutdown key code.
In an example, the preset event is any event in a preset event list, that is, whether a trigger event exists is monitored based on an application layer of an operating system configured in advance 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 trigger event exists, the preset event list for sending target data to a target device is determined to be monitored.
In an example, based on an application layer of an operating system configured in advance in an electronic device, a trigger event record list is periodically read one by one, the read trigger event is matched with the preset event, and if the matching is successful, it is determined that the preset event for sending to a target device exists.
S102: when the preset event is monitored, locking cache resources 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 resources are 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 program Framework (FWK), a system operation layer and the linux kernel layer, and the layers communicate with one another through software interfaces.
The application layer may include a series of application packages, and the application packages may include one or more of short messages, calendars, cameras, videos, navigation, calls, keyboards and other applications.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program 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 comprises one or more of a view system, a content provider, a resource manager, a notification manager, and an activity manager.
Wherein the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and the like. The view system may be used to build applications such that the display interface of the electronic device may be comprised of one or more views. For example, the display interface including the short message notification icon may include a view displaying text and a view displaying pictures, and may include a display interface including a keyboard icon.
The Content Providers (Content Providers) allow an application to access data of another application (e.g. a contact database) or to 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 reminder information in a status bar of the electronic device.
The Activity Manager (Activity Manager) is used to manage the application lifecycle and provide the usual navigation fallback functionality.
The system layer may include a plurality of functional modules. For example: a sensor service module, a physical state recognition module, a three-dimensional graphics processing library (e.g., OpenGL ES), and the like.
The sensor service module is used for monitoring sensor data uploaded by various sensors in a hardware layer and determining the physical state of the electronic equipment.
The physical state recognition module is used for analyzing and recognizing user gestures, human faces and the like;
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 provide seamless merging 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 equipment, such as a display screen, an infrared emission 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 the corresponding target data are sent to the linux kernel through an application layer of the operating system, when the linux kernel receives the preset event, the preset service thread is enabled through the linux kernel, and then the cache resource is locked from the operating system through the preset service thread according to the size of the target data, so as to wait for the target data to be cached to the cache resource continuously. And the locking time of the cache resource is from the locking of the operating system by the preset service thread to the complete transmission of the target data to the target equipment.
In order to enable the preset service thread to continuously run without being interrupted by the scheduler of the operating system, so that target data can be completely sent to a target device without delay, the priority of the preset service thread is the highest priority, and the scheduling policy is set as a non-real-time scheduling policy (FiFo).
In an example, the target data is code value data corresponding to a key code of the infrared remote controller. And when an infrared event is monitored, sending the infrared event and code value data corresponding to the infrared event to a linux kernel through an application layer of the operating system.
And when the infrared event is received by the linux kernel, the preset service thread is started, the 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 into the cache resource.
And when the code value data exists in the cache resources, the code value data is sent to the target equipment through the preset service thread.
In an example, when the target data is completely cached in the cache resource, the target data is read from the cache resource and sent to the target device through the preset service thread, and after the target data is sent to the target device, the locked cache resource is released.
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, a sending component on the electronic device is called, and the target data is sent to the target device based on the electric signal.
Illustratively, the code value data corresponding to the infrared event is continuously read from the cache resource through the preset service thread, an electrical signal is generated according to the code value data, an infrared emission tube on the electronic device is called at the same time, and an optical signal is sent to the target device based on the electrical signal, so that the code value data is sent to the target device, for example, the optical signal is sent to a smart television.
Specifically, the target data includes an address code, an address bar code, a command code, and a command bar code, where the address code and the command code are first phase data, and the address bar code and the command bar 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 bar code and the command bar code are identified as second phase data, and the electric signal is generated by 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.
And controlling to generate 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.
Illustratively, the target data is sequentially configured as an address code, an address complement, a command code, and a command complement, 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 anti-code is 000000, the command code is 11111111, and the command anti-code is 000000.
And the preset service thread generates high and low level signals according to the sequence control of the data formed in the target data. If an address code or a command code is sent, the preset service thread drives the gpio port to set a high level, keep the high level for 0.56ms, set a low level again, and keep the low level for 1.68ms, so as to modulate and obtain a data waveform corresponding to the address code or the command code, send the modulated and obtained corresponding data waveform to a target device through a sending component which is arranged on the electronic device and connected with an output port (the gpio port), and then the target device analyzes target data according to the received data waveform. Or when the address code reversal or the command code reversal is sent, the preset service thread drives the gpio port to set a high level, keep the high level for 0.56ms, then set the low level, keep the low level for 0.56ms, so as to modulate and obtain a data waveform corresponding to the address code reversal or the command code reversal, and send the modulated corresponding data waveform to the target equipment through a sending component which is arranged on the electronic equipment and connected with an output port (the gpio port), and then the target equipment carries out target data analysis according to the received data waveform.
In an example, the sending component is an infrared transmitting tube, and the preset service thread controls and generates a high-low level signal according to the first phase data and the second phase data in the target data, so as to drive the infrared transmitting tube to operate, thereby forming a specific optical signal to be sent to the target device, and sending the target data to the target device.
In an example, in order to facilitate a target device to better recognize and receive the target data, the preset service thread controls to generate a high-low level signal to drive the sending component to operate according to the first phase data and the second phase data in the target data, so that before the target data is sent to the target device, the preset service thread generates a guide high-low level signal to drive the sending component to operate according to a guide code of a first preset length, and sends guide identification data to the target device. The pilot code is first phase data.
Illustratively, the boot code is 1111111111111111. Before the target data is sent, the preset service thread drives the gpio port to set a high level for 9ms, set a low level for 4.5ms, and send the data waveform corresponding to the pilot code obtained through modulation to the target device through a sending component which is arranged on the electronic device and connected with an output port (the gpio port).
In an example, in order to facilitate a target device to better recognize that the target device stops receiving 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 sending component to run, so that after the target data is sent to the target device, the preset service thread generates a stop electrical signal according to a stop code of a second preset length to drive the sending component to run, and sends stop identification data to the target device. The stop code is second phase data.
Illustratively, the stop code is 0000. After the target data are all sent to the target equipment, the preset service thread drives the gpio to set a high level according to the stop code, keeps the high level for 0.56ms, and sets the high level to a low level, so that a data waveform corresponding to the pilot code obtained through modulation 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).
In an example, the target data includes an address code, an address inverse, a command code, and a command inverse, wherein the address code, the address inverse, the command code, or the command inverse 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.
Illustratively, the target data is sequentially configured as an address code, an address complement, a command code, and a command complement, 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, address code 11110000, address code violation 110000, command code violation 11111000, and command code violation 111000.
And the preset service thread generates high and low level signals according to the sequence control of the data formed in the target data.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 2 shows a block diagram of a data transmission device according to an embodiment of the present application, which corresponds to the data transmission method according to the foregoing embodiment, and only the relevant portions of the data transmission device according to the embodiment of the present application are shown for convenience of description.
Referring to fig. 2, the apparatus includes:
the monitoring module is used for monitoring a preset event for sending target data to the 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 the preset event to the linux kernel by an application layer of the operating system when the preset event is monitored.
Optionally, the locking module includes a starting unit and a locking unit, 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 a cache resource from the operating system according to the size of the target data by the preset service thread.
Optionally, the sending module is configured to control and generate an electrical signal according to the target data through the preset service thread, and drive a sending component arranged on the electronic device to run based on the electrical signal, so as to send the target data to the target device.
Optionally, the target data includes an address code, an address bar code, a command code, and a command bar code, where the address code and the command code are first phase data, and the address bar code and the command bar 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 run, 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, wherein the processor 30 implements the steps of any of the various data transmission method embodiments described above when executing the computer program 32.
The electronic device 3 may be a remote controller, a desktop computer, a notebook, a palm computer, or other computing devices. The electronic device may include, but is not limited to, a processor 30, a memory 31. Those skilled in the art will appreciate that fig. 3 is only an example of the electronic device 3, and does not constitute a limitation to the electronic device 3, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 30 may be a Central Processing Unit (CPU), and the Processor 30 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. 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 also be an external storage device of the electronic device 3 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and 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, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 31 may also be used to temporarily store data that has been output or is to be output.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of 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 processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on an electronic device, enables the electronic device to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an 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 photographing apparatus/electronic device, a recording medium, computer Memory, Read-Only Memory (ROM), random-access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
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 implementation. 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 ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (10)
1. A data sending method is applicable to electronic equipment, and is characterized in that an operating system based on a linux kernel is configured on the electronic equipment in advance, and the method comprises the following steps:
monitoring a preset event for transmitting target data to target equipment;
When the preset event is monitored, locking cache resources 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.
2. The data sending method according to claim 1, wherein the locking cache resources from the operating system through a preset service thread in the linux kernel when the preset event is monitored comprises:
when the preset event is monitored, sending the preset event 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 through the preset service thread according to the size of the target data.
3. The data transmission method according to claim 1, wherein the transmitting the target data to the target device through the preset service thread includes:
controlling to generate an electric signal according to the target data through the preset service thread;
And calling a sending component on the electronic equipment, and sending the target data to the target equipment based on the electric signal.
4. The data transmission method as claimed in claim 3, wherein the target data includes an address code, an address complement, a command code and a command complement.
5. The data transmission method according to claim 4, wherein the controlling, by the preset service thread, generation of an electrical signal according to the target data comprises:
identifying the address code and the command code as first phase data and the address bar code and the command bar code as second phase data;
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.
6. The method of claim 5, wherein the sending component is an infrared transmitting tube;
the invoking a sending component on the electronic device, sending the target data to the target device based on the electrical signal, comprising:
and controlling to generate high and low level signals 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.
7. The data transmission method according to claim 1, wherein after the preset service thread transmits the target data to the target device, the method includes:
and when the target data is sent to the end, the preset service thread enters a dormant state.
8. A data sending device is characterized in that an operating system based on a linux kernel is configured on the data sending device in advance, and the device comprises:
the monitoring module is used for monitoring a preset event for sending target data to the 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.
9. 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 of claims 1 to 7 when executing the computer program.
10. 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 of any one of claims 1 to 7.
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 true CN111858084A (en) | 2020-10-30 |
CN111858084B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113395327A (en) * | 2021-05-24 | 2021-09-14 | 深圳市元征未来汽车技术有限公司 | Data processing method, device, electronic equipment and medium |
Citations (4)
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 |
-
2020
- 2020-06-02 CN CN202010489483.1A patent/CN111858084B/en active Active
Patent Citations (4)
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 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113395327A (en) * | 2021-05-24 | 2021-09-14 | 深圳市元征未来汽车技术有限公司 | Data processing method, device, electronic equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN111858084B (en) | 2023-07-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108491275B (en) | Program optimization method, device, terminal and storage medium | |
WO2022127661A1 (en) | Application sharing method, and electronic device and storage medium | |
CN115525453B (en) | Multi-screen collaborative interrupt processing method and electronic equipment | |
CN114286165A (en) | Display device, mobile terminal and screen projection data transmission method | |
CN110266582B (en) | Message pushing method, system, server and communication terminal | |
CN112764817A (en) | Equipment function awakening method and device | |
CN112835632B (en) | Method and equipment for calling end capability and computer storage medium | |
CN111858084B (en) | Data transmission method and device, electronic equipment and storage medium | |
CN113593279B (en) | Vehicle, interaction parameter adjusting method thereof and mobile terminal | |
CN114647390B (en) | Enhanced screen sharing method and system and electronic equipment | |
CN112653608B (en) | Display device, mobile terminal and cross-network data transmission method | |
CN113938890B (en) | Data sharing method and terminal equipment | |
CN113835889A (en) | Method for acquiring input event and related device | |
CN110492935B (en) | Data processing system, method and device and terminal equipment | |
CN114286320A (en) | Display device, mobile terminal and Bluetooth connection method | |
CN111159734A (en) | Communication terminal and multi-application data inter-access processing method | |
CN114595017B (en) | Data display method and device, electronic equipment and computer readable storage medium | |
CN113268300B (en) | Information display method and device | |
CN111142648B (en) | Data processing method and intelligent terminal | |
US20180004476A1 (en) | Media production to operating system supported display | |
CN116048829B (en) | Interface calling method, device and storage medium | |
WO2023010918A1 (en) | Information processing method, terminal device, cloud server, and storage medium | |
CN116744106B (en) | Control method of camera application and terminal equipment | |
CN118740971A (en) | Method, apparatus and storage medium for processing configuration change | |
CN115061702B (en) | IDE management method and electronic equipment |
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 |