CN112929334B - Data transmission method, terminal and storage medium - Google Patents

Data transmission method, terminal and storage medium Download PDF

Info

Publication number
CN112929334B
CN112929334B CN202110074171.9A CN202110074171A CN112929334B CN 112929334 B CN112929334 B CN 112929334B CN 202110074171 A CN202110074171 A CN 202110074171A CN 112929334 B CN112929334 B CN 112929334B
Authority
CN
China
Prior art keywords
display data
byte
bytes
compression packet
field
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
CN202110074171.9A
Other languages
Chinese (zh)
Other versions
CN112929334A (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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN202110074171.9A priority Critical patent/CN112929334B/en
Publication of CN112929334A publication Critical patent/CN112929334A/en
Application granted granted Critical
Publication of CN112929334B publication Critical patent/CN112929334B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC

Abstract

The embodiment of the invention discloses a data transmission method, a terminal and a storage medium, and belongs to the technical field of electronic price tags. The method is based on a base station end and comprises the following steps: receiving display data issued by a server; and compressing the display data by adopting a preset stream compression algorithm, generating a corresponding display data compression packet and storing the corresponding display data compression packet. When the method is based on the electronic price tag end, the method comprises the following steps: a new display data request is sent to the base station, and when the display data request passes, a display data compression packet sent by the base station is received; and carrying out decompression processing on the display data compression packet by adopting a preset streaming decompression algorithm, outputting corresponding display data and displaying the corresponding display data on a current screen. According to the technical scheme, the technical problems of failure rate and time increase of transmission caused by overlarge transmission data volume when the existing electronic price tag and the base station perform data transmission can be effectively solved.

Description

Data transmission method, terminal and storage medium
Technical Field
The embodiment of the invention relates to the technical field of electronic price tags, in particular to a data transmission method, a terminal and a storage medium.
Background
The electronic price tag is an electronic display device with an information receiving and transmitting function, and is mainly applied to electronic tags for displaying price information in supermarkets, convenience stores, pharmacies and the like. When the electronic price tag is placed on a goods shelf, the electronic price tag can replace the traditional paper price tag, each electronic price tag is connected with a market computer database (namely a base station) through a wired or wireless network, and the latest commodity information is displayed through a screen on the electronic price tag. It can be seen that the electronic price tag has in fact successfully incorporated the shelf into a computer program, getting rid of the situation of manually replacing the price tag, realizing the price consistency between the cash register and the shelf, and being popular with more and more users. However, when data is transmitted between the existing electronic price tag and the base station, the base station does not further process the display data, and then directly transmits the display data to the electronic price tag, so that when the transmission data volume is too large, the failure rate and time of transmission are easily increased.
Disclosure of Invention
The embodiment of the invention mainly aims to provide a data transmission method, a terminal and a storage medium, and aims to solve the technical problems of transmission failure rate and time increase caused by overlarge transmission data volume when data transmission is carried out between an existing electronic price tag and a base station.
In order to achieve the above object, an embodiment of the present invention provides a method for data transmission, based on a base station, the method includes the following steps: receiving display data issued by a server; and compressing the display data by adopting a preset stream compression algorithm, generating a corresponding display data compression packet and storing the corresponding display data compression packet.
Optionally, the step of compressing the display data by using a preset stream compression algorithm specifically includes: dividing the display data into a header field and a sub-field in sequence, wherein the length of the header field is a preset fixed length; reading the header field and directly compressing the header field into the display data compression packet; dividing the sub-field into a plurality of field units in turn, writing the field units into the display data compression packet one by one according to a first preset mode, wherein each field unit consists of a plurality of bytes with the same continuous content or a plurality of bytes with different continuous contents, and the length of each field unit is smaller than or equal to 127 bytes
Optionally, the step of writing the plurality of field units into the display data compression packet one by one according to a first preset manner specifically includes: if the field unit consists of a plurality of bytes with the same continuous content, writing a first flag byte and one byte content of the field unit into the display data compression packet; and if the field unit consists of a plurality of bytes with different continuous contents, writing a second flag byte and all byte contents of the field unit into the display data compression packet.
Optionally, the highest bit of the first flag byte is 1, and the remaining seven bits of the first flag byte are used for recording the length of the corresponding field unit; the highest bit of the second flag byte is 0, and the remaining seven bits of the second flag byte are used for recording the length of the corresponding field unit.
In addition, in order to achieve the above objective, the embodiment of the present invention further provides a data transmission method, based on an electronic price tag terminal, the method includes the following steps: a new display data request is sent to a base station, and when the display data request passes, a display data compression packet sent by the base station is received; and carrying out decompression processing on the display data compression packet by adopting a preset streaming decompression algorithm, outputting corresponding display data and displaying the corresponding display data on a current screen.
Optionally, the step of performing decompression processing on the display data compression packet by using a preset streaming decompression algorithm specifically includes: reading bytes with preset fixed length from the display data compression packet, and outputting the bytes as a corresponding header field of the display data; sequentially reading each byte after the header field in the display data compression packet to find out each marking byte in the display data compression packet; and according to each marking byte, sequentially converting a plurality of bytes between the current marking byte and the next marking byte into corresponding field units according to a second preset mode so as to output the corresponding sub-fields of the display data.
Optionally, the flag byte includes a first flag byte and a second flag byte, the highest bit of the first flag byte is 1, and the highest bit of the second flag byte is 0.
Optionally, the step of sequentially converting, according to each flag byte, a plurality of bytes between the current flag byte and the next flag byte into corresponding field units according to a second preset manner specifically includes: if the marked byte is the first byte, after the length N of the corresponding field unit is obtained by dividing the marked byte by the rest seven bits of the highest bit, creating N objects for one byte between the current marked byte and the next marked byte, and generating N bytes of the corresponding field unit; and if the marked byte is the second byte, acquiring the length N of the corresponding field unit according to the rest seven bits of the marked byte except the most significant bit, and sequentially reading N bytes between the current marked byte and the next marked byte to serve as N bytes of the corresponding field unit.
In addition, in order to achieve the above object, an embodiment of the present invention also proposes a terminal including a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for implementing connection communication between the processor and the memory, the program implementing the steps of the above method when executed by the processor.
In addition, to achieve the above object, an embodiment of the present invention also proposes a storage medium for computer-readable storage, the storage medium storing one or more programs executable by one or more processors to implement the steps of the above method.
When the base station end of the data transmission method, the terminal and the storage medium provided by the embodiment of the invention performs data transmission, when the base station end receives display data issued by the server, a preset stream compression algorithm is adopted to compress the display data, and then a corresponding display data compression packet is generated and stored. When the electronic price tag end transmits data, a new display data request is sent to the base station, and when the display data request passes, a display data compression packet sent by the base station is received. And then, carrying out decompression processing on the display data compression packet by adopting a preset streaming decompression algorithm, outputting corresponding display data and displaying the corresponding display data on a current screen. Therefore, when the electronic price tag and the base station are used for data transmission, the display data compression packet obtained by compressing the display data through the preset stream compression algorithm is transmitted between the electronic price tag and the base station, the data volume of the display data compression packet is greatly reduced compared with the original display data, and the failure rate and the time spent for data transmission can be greatly reduced. Therefore, the technical scheme can effectively solve the technical problems of failure rate and time increase of transmission caused by overlarge data transmission quantity when the data transmission is carried out between the existing electronic price tag and the base station.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention.
Fig. 2 is a diagram of a communication network system architecture on which the mobile terminal shown in fig. 1 is based.
Fig. 3 is a flowchart of a method for data transmission according to an embodiment of the present invention.
Fig. 4 is a specific flowchart of step S120 of the data transmission method shown in fig. 3.
Fig. 5 is a flowchart of a method for data transmission according to an embodiment of the present invention.
Fig. 6 is a specific flowchart of step S220 of the data transmission method shown in fig. 5.
Fig. 7 is a block diagram of a third terminal according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
The terminal may be implemented in various forms. For example, the terminals described in the present invention may include mobile terminals such as cell phones, tablet computers, notebook computers, palm computers, personal digital assistants (Personal Digital Assistant, PDA), portable media players (Portable Media Player, PMP), navigation devices, wearable devices, smart bracelets, pedometers, and fixed terminals such as digital TVs, desktop computers, and the like.
The following description will be given taking a mobile terminal as an example, and those skilled in the art will understand that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for a moving purpose.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention, the mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal structure shown in fig. 1 is not limiting of the mobile terminal and that the mobile terminal may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be used for receiving and transmitting signals during a message or a call, specifically, receiving a downlink message of a base station, and then processing the downlink message with the processor 110; and, the uplink data is transmitted to the base station. Typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication, global System for Mobile communications), GPRS (General Packet Radio Service ), CDMA2000 (Code Division Multiple Access, CDMA 2000), WCDMA (Wideband Code Division Multiple Access ), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, time Division synchronous code Division multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, frequency Division Duplex Long term evolution), and TDD-LTE (Time Division Duplexing-Long Term Evolution, time Division Duplex Long term evolution), etc.
WiFi belongs to a short-distance wireless transmission technology, and a mobile terminal can help a user to send and receive e-mails, browse web pages, access streaming media and the like through the WiFi module 102, so that wireless broadband Internet access is provided for the user. Although fig. 1 shows a WiFi module 102, it is understood that it does not belong to the necessary constitution of a mobile terminal, and can be omitted entirely as required within a range that does not change the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output (e.g., a call signal reception sound, a message reception sound, etc.) related to a specific function performed by the mobile terminal 100. The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive an audio or video signal. The a/V input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound into audio data. The processed audio (voice) data may be converted into a format output that can be transmitted to the mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting the audio signal.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 1061 and/or the backlight when the mobile terminal 100 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; as for other sensors such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured in the mobile phone, the detailed description thereof will be omitted.
The display unit 106 is used to display a message input by a user or a message provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive an input numeric or character message and to generate key signal inputs related to user settings and function control of the mobile terminal. In particular, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1071 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives a touch message from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 110, and can receive commands from the processor 110 and execute them. Further, the touch panel 1071 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 107 may include other input devices 1072 in addition to the touch panel 1071. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc., as specifically not limited herein.
Further, the touch panel 1071 may overlay the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or thereabout, the touch panel 1071 is transferred to the processor 110 to determine the type of touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of touch event. Although in fig. 1, the touch panel 1071 and the display panel 1061 are two independent components for implementing the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 may be integrated with the display panel 1061 to implement the input and output functions of the mobile terminal, which is not limited herein.
The interface unit 108 serves as an interface through which at least one external device can be connected with the mobile terminal 100. For example, the external devices may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data messages, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power source 111 (e.g., a battery) for supplying power to the respective components, and preferably, the power source 111 may be logically connected to the processor 110 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based will be described below.
Referring to fig. 2, fig. 2 is a schematic diagram of a communication network system according to an embodiment of the present invention, where the communication network system is an LTE system of a general mobile communication technology, and the LTE system includes a UE (User Equipment) 201, an e-UTRAN (Evolved UMTS Terrestrial Radio Access Network ) 202, an epc (Evolved Packet Core, evolved packet core) 203, and an IP service 204 of an operator that are sequentially connected in communication.
Specifically, the UE201 may be the terminal 100 described above, and will not be described herein.
The E-UTRAN202 includes eNodeB2021 and other eNodeB2022, etc. The eNodeB2021 may be connected with other eNodeB2022 by a backhaul (e.g., an X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide access from the UE201 to the EPC 203.
EPC203 may include MME (Mobility Management Entity ) 2031, hss (Home Subscriber Server, home subscriber server) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, pgw (PDN Gate Way) 2035 and PCRF (Policy and Charging Rules Function, policy and tariff function entity) 2036, and so on. The MME2031 is a control node that handles signaling between the UE201 and EPC203, providing bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location registers (not shown) and to hold subscriber-specific messages regarding service characteristics, data rates, etc. All user data may be sent through SGW2034 and PGW2035 may provide IP address allocation and other functions for UE201, PCRF2036 is a policy and charging control policy decision point for traffic data flows and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem ), or other IP services, etc.
Although the LTE system is described above as an example, it should be understood by those skilled in the art that the present invention is not limited to LTE systems, but may be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and the communication network system, various embodiments of the method of the present invention are provided.
Example 1
As shown in fig. 3, a first embodiment of the present invention provides a data transmission method, based on a base station, the method includes the following steps:
step S110: and receiving display data issued by the server.
Specifically, the display information of the electronic price tag is updated regularly or irregularly, at this time, the electronic price tag needs to request the base station to request the corresponding display data, the display data of the base station needs to be obtained from the server, when the server receives the request for updating the display data sent by the base station, the corresponding display data is sent to the base station, and at this time, the base station can receive the display data sent by the server.
Step S120: and compressing the display data by adopting a preset stream compression algorithm, generating a corresponding display data compression packet and storing the corresponding display data compression packet.
Specifically, after the base station receives the display data issued by the server through the method steps, in order to facilitate subsequent storage and sending to the corresponding electronic price tag, the base station compresses the display data by adopting a preset stream compression algorithm to generate a corresponding display data compression packet and store the corresponding display data compression packet, as shown in fig. 4, the specific process is as follows:
step S121: dividing display data into a header field and a sub-field in sequence, wherein the length of the header field is a preset fixed length.
Step S122: the header field is read and is directly uncompressed into the display data compression packet.
Step S123: dividing the sub-field into a plurality of field units in sequence, writing the field units into the display data compression packet one by one according to a first preset mode, wherein each field unit consists of a plurality of bytes with the same continuous content or a plurality of bytes with different continuous content, and the length of each field unit is smaller than or equal to 127 bytes.
The preset fixed length can be set by the user according to the user requirement, preferably, the preset fixed length is specifically 24 bytes, namely the first 24 bytes of the display data are used as a header field, the 25 th byte is used as a sub field, the sub field is divided into a plurality of field units in sequence, three bytes can be read in sequence, if the three bytes are identical in content, the contents of the rear most probability are predicted to be identical, at this time, the reading of the rear original file is continued until the contents of the rear original file are different or the length reaches 127 or the end of the file is encountered, a field unit is divided, and similarly, if the contents of the three bytes are different, the contents of the rear most probability are predicted to be different, at this time, the contents of the rear original file are continuously read until the contents of the rear original file are encountered or the length reaches 127 or the end of the file is predicted, and a field unit is also divided. After each field unit is divided, the above operation is continuously repeated until the sub-field is divided into a plurality of field units, at this time, each field unit is composed of a plurality of bytes with the same continuous content or a plurality of bytes with different continuous content, and the length of each field unit is less than or equal to 127 bytes.
In addition, the method steps are executed, wherein the step of writing the field units into the display data compression packet one by one according to the first preset mode is specifically as follows: if the field unit consists of a plurality of bytes with the same continuous content, writing the first flag byte and one byte content of the field unit into the display data compression packet; if the field unit is composed of a plurality of bytes with different continuous contents, the second flag byte and all byte contents of the field unit are written into the display data compression packet. In the above method steps, the highest bit of the first flag byte is 1, and the remaining seven bits of the first flag byte are used for recording the length of the corresponding field unit. The highest bit of the second flag byte is 0, and the remaining seven bits of the second flag byte are used for recording the length of the corresponding field unit.
Generally, the operations of dividing the sub-field into a plurality of field units and writing the plurality of field units into the display data compression packet one by one according to the first preset mode are performed synchronously, i.e. after dividing one field unit, writing the divided field unit into the display data compression packet according to the first preset mode, and then dividing and writing the next field unit. It is known from the above method steps that, for a field unit composed of a plurality of bytes with the same continuous content, only two bytes are needed to store the content of the field unit, one is a first flag byte for indicating the type of the field unit and the length of the field unit (i.e. the field unit is composed of several bytes), and the other is one byte in the field unit (immediately following the first flag byte). For a field unit composed of a plurality of bytes with different continuous contents, a second flag byte (located before the field unit) needs to be added to the original field unit for storage, where the second flag byte is used to indicate the type of the field unit and the length of the field unit (i.e. the field unit is composed of several bytes).
Example two
As shown in fig. 5, a second embodiment of the present invention provides a data transmission method, based on an electronic price tag, the method includes the following steps:
step S210: and sending a new display data request to the base station, and receiving a display data compression packet sent by the base station when the display data request passes.
Specifically, the display information of the electronic price tag is updated at regular or irregular time, and at this time, the electronic price tag needs to request the base station to request corresponding display data, that is, send a new display data request to the base station, and when the display data request passes, receive a display data compression packet sent by the base station, where the display data compression packet is a display data compression packet obtained by compressing the display data by using a preset stream compression algorithm in the first embodiment.
Step S220: and carrying out decompression processing on the display data compression packet by adopting a preset streaming decompression algorithm, outputting corresponding display data and displaying the corresponding display data on a current screen.
Specifically, as can be seen from the above method steps, the display data compressed packet received from the base station is unable to be directly displayed, and a preset stream decompression algorithm is required to decompress the display data compressed packet, and output corresponding display data and display the display data on the current screen, as shown in fig. 6, the specific process is as follows:
step S221: and reading bytes with preset fixed length in the display data compression packet, and outputting the bytes as a header field of corresponding display data.
Step S221: each byte after the header field is read in turn in the display data compression packet to find out each flag byte in the display data compression packet.
Step S221: and according to each marking byte, sequentially converting a plurality of bytes between the current marking byte and the next marking byte into corresponding field units according to a second preset mode so as to output the corresponding sub-fields of the display data.
Since the preset streaming decompression algorithm in the embodiment of the present method is a reverse decoding process of the preset streaming compression algorithm in the first embodiment, the preset fixed length is equal to the preset fixed length in the first embodiment. Since the predetermined fixed length in the first embodiment is specifically 24 bytes, at this time, the predetermined 24 bytes are read in the display data compression packet, and output as the header field of the corresponding display data. In the first embodiment, the method steps of the first embodiment can be used for finding out each flag byte in the display data compression packet by alternately composing the flag byte (including the first flag byte and the second flag byte, the highest bit of the first flag byte is 1, and the highest bit of the second flag byte is 0) and the content byte, and sequentially reading each byte after the header field in the display data compression packet, and sequentially converting a plurality of bytes between the current flag byte and the next flag byte into corresponding field units according to each flag byte in a second preset manner to output the sub-field as corresponding display data. The specific process is as follows: if the marked byte is the first byte, after the length N of the corresponding field unit is obtained by dividing the marked byte by the rest seven bits of the most significant bit, creating N objects for one byte between the current marked byte and the next marked byte, and generating N bytes of the corresponding field unit; if the marked byte is the second byte, the length N of the corresponding field unit is obtained by dividing the marked byte by the rest seven bits of the most significant bit, and then N bytes between the current marked byte and the next marked byte are sequentially read to be used as N bytes of the corresponding field unit.
In general, the operations of finding out each flag byte in the display data compression packet and sequentially converting a plurality of bytes between the current flag byte and the next flag byte into corresponding field units according to each flag byte in a second preset manner are performed synchronously, i.e. after finding out one flag byte, converting a plurality of bytes between the current flag byte and the next flag byte into corresponding field units according to the second preset manner for outputting. After the header field is read, the first byte read is a flag byte, at this time, whether the flag byte is a first flag byte or a second flag byte is analyzed according to the highest bit of the flag byte, if the flag byte is the first byte, the first byte immediately following the flag byte is the content byte of the corresponding field unit, and the second byte immediately following the flag byte is the next flag byte, at this time, after the length N of the corresponding field unit is obtained by dividing the flag byte by the remaining seven bits of the highest bit, N objects are created for one byte between the current flag byte and the next flag byte, and N bytes of the corresponding field unit are generated to output the corresponding field unit. If the marked byte is the second byte, the length N of the corresponding field unit is obtained by dividing the marked byte by the rest seven bits of the highest bit, and then the N bytes after the marked byte are the content bytes of the corresponding field unit, the (n+1) th byte after the marked byte is the next marked byte, and the N bytes between the current marked byte and the next marked byte are sequentially read to be used as the N bytes of the corresponding field unit so as to output the corresponding field unit.
Example III
As shown in fig. 7, a third embodiment of the present invention proposes a terminal 20, where the terminal 20 includes a memory 21, a processor 22, a program stored on the memory and capable of running on the processor, and a data bus 23 for implementing connection communication between the processor 21 and the memory 22, and the program is executed by the processor to implement the steps of the method for data transmission in the first embodiment, which is specifically described above and not repeated herein.
It should be noted that the embodiment of the terminal 20 and the embodiment of the method in the embodiment of the present invention belong to the same concept, the detailed implementation process of the embodiment of the method in the embodiment of the present invention is shown in the embodiment of the method in the embodiment one, and the technical features in the embodiment of the method in the embodiment one are correspondingly applicable in the embodiment of the terminal 20, and are not repeated herein.
Example IV
The fourth embodiment of the present invention proposes a storage medium for computer readable storage, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement specific steps of the method for data transmission in the first embodiment.
It should be noted that the storage medium and the method embodiment belong to the same concept, the detailed implementation process of the storage medium and the method embodiment one are shown in the method embodiment one, and the technical features in the method embodiment one are correspondingly applicable to the storage medium embodiment, which is not repeated herein.
When the base station end of the data transmission method, the terminal and the storage medium provided by the embodiment of the invention performs data transmission, when the base station end receives display data issued by the server, a preset stream compression algorithm is adopted to compress the display data, and then a corresponding display data compression packet is generated and stored. When the electronic price tag end transmits data, a new display data request is sent to the base station, and when the display data request passes, a display data compression packet sent by the base station is received. And then, carrying out decompression processing on the display data compression packet by adopting a preset streaming decompression algorithm, outputting corresponding display data and displaying the corresponding display data on a current screen. Therefore, when the electronic price tag and the base station are used for data transmission, the display data compression packet obtained by compressing the display data through the preset stream compression algorithm is transmitted between the electronic price tag and the base station, the data volume of the display data compression packet is greatly reduced compared with the original display data, and the failure rate and the time spent for data transmission can be greatly reduced. Therefore, the technical scheme can effectively solve the technical problems of failure rate and time increase of transmission caused by overlarge data transmission quantity when the data transmission is carried out between the existing electronic price tag and the base station.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (4)

1. A method for data transmission based on a base station, the method comprising the steps of:
receiving display data issued by a server;
compressing the display data by adopting a preset stream compression algorithm, generating a corresponding display data compression packet and storing the corresponding display data compression packet;
the step of compressing the display data by adopting a preset stream compression algorithm specifically comprises the following steps:
dividing the display data into a header field and a sub-field in sequence, wherein the length of the header field is a preset fixed length, and the preset fixed length is 24 bytes;
reading the header field and directly compressing the header field into the display data compression packet;
dividing the sub-field into a plurality of field units in sequence, writing the field units into the display data compression packet one by one according to a first preset mode, wherein each field unit consists of a plurality of bytes with the same continuous content or a plurality of bytes with different continuous contents, and the length of each field unit is smaller than or equal to 127 bytes;
the step of writing the plurality of field units into the display data compression packet one by one according to a first preset mode specifically includes:
if the field unit consists of a plurality of bytes with the same continuous content, writing a first marked byte and one byte content of the field unit into the display data compression packet;
if the field unit consists of a plurality of bytes with different continuous contents, writing a second marked byte and all byte contents of the field unit into the display data compression packet;
the most significant bit of the first flag byte is 1, and the remaining seven bits of the first flag byte are used for recording the length of the corresponding field unit; the most significant bit of the second flag byte is 0, and the remaining seven bits of the second flag byte are used to record the length of the corresponding field unit.
2. A method for data transmission based on an electronic price tag terminal, the method comprising the steps of:
a new display data request is sent to a base station, and when the display data request passes, a display data compression packet sent by the base station is received;
decompressing the display data compression packet by adopting a preset streaming decompression algorithm, outputting corresponding display data and displaying the corresponding display data on a current screen;
the step of decompressing the display data compression packet by adopting a preset stream decompression algorithm specifically comprises the following steps:
reading bytes with preset fixed length from the display data compression packet, and outputting the bytes as a corresponding header field of the display data, wherein the preset fixed length is 24 bytes;
sequentially reading each byte after the header field in the display data compression packet to find out each marking byte in the display data compression packet;
according to each marking byte, converting a plurality of bytes between the current marking byte and the next marking byte into corresponding field units according to a second preset mode in sequence so as to output a sub-field which is corresponding to the display data;
the marking bytes comprise a first marking byte and a second marking byte, wherein the highest bit of the first marking byte is 1, and the highest bit of the second marking byte is 0;
the step of sequentially converting a plurality of bytes between the current marked byte and the next marked byte into corresponding field units according to each marked byte in a second preset mode specifically comprises the following steps:
if the marked byte is the first marked byte, after the length N of the corresponding field unit is obtained according to the marked byte divided by the rest seven bits of the highest bit, creating N objects for one byte between the current marked byte and the next marked byte, and generating N bytes of the corresponding field unit;
and if the marked byte is the second marked byte, acquiring the length N of the corresponding field unit according to the rest seven bits of the marked byte except the highest bit, and sequentially reading N bytes between the current marked byte and the next marked byte to serve as N bytes of the corresponding field unit.
3. An apparatus for data transmission, comprising: a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for enabling a connected communication between the processor and the memory, which program, when being executed by the processor, implements the steps of the method according to any of claims 1-2.
4. A storage medium for computer readable storage, wherein the storage medium stores one or more programs executable by one or more processors to implement the steps of the method of any of claims 1-2.
CN202110074171.9A 2021-01-20 2021-01-20 Data transmission method, terminal and storage medium Active CN112929334B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110074171.9A CN112929334B (en) 2021-01-20 2021-01-20 Data transmission method, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110074171.9A CN112929334B (en) 2021-01-20 2021-01-20 Data transmission method, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN112929334A CN112929334A (en) 2021-06-08
CN112929334B true CN112929334B (en) 2023-11-14

Family

ID=76164222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110074171.9A Active CN112929334B (en) 2021-01-20 2021-01-20 Data transmission method, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN112929334B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5546575A (en) * 1994-05-23 1996-08-13 Basil E. Potter & Associates, Inc. Encoding method for compressing a tabular database by selecting effective compression routines for each field and structure of partitions of equal sized records
CN106850141A (en) * 2017-01-20 2017-06-13 济南浪潮高新科技投资发展有限公司 A kind of physical message system data Lossless Compression transmission method of use DEFLATE algorithms
CN107343259A (en) * 2017-07-03 2017-11-10 苏州汉朗光电有限公司 A kind of wireless electronic tag systems and its multiband low power consumption data safe transmission method
CN108990004A (en) * 2018-08-06 2018-12-11 上海保资智能科技有限公司 A kind of the display information transferring method and system of electronics price tag
CN109190727A (en) * 2018-08-06 2019-01-11 上海保资智能科技有限公司 A kind of the display information amending method and system of electronics price tag
CN109788510A (en) * 2019-01-25 2019-05-21 雅量商业智能技术(广州)有限公司 A kind of method for realizing low power consumption of electronics price tag system
CN111507466A (en) * 2019-01-30 2020-08-07 北京沃东天骏信息技术有限公司 Data processing method and device, electronic equipment and readable medium
CN112149450A (en) * 2019-06-26 2020-12-29 浙江汉朔电子科技有限公司 Noodle arrangement inspection system and method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5546575A (en) * 1994-05-23 1996-08-13 Basil E. Potter & Associates, Inc. Encoding method for compressing a tabular database by selecting effective compression routines for each field and structure of partitions of equal sized records
CN106850141A (en) * 2017-01-20 2017-06-13 济南浪潮高新科技投资发展有限公司 A kind of physical message system data Lossless Compression transmission method of use DEFLATE algorithms
CN107343259A (en) * 2017-07-03 2017-11-10 苏州汉朗光电有限公司 A kind of wireless electronic tag systems and its multiband low power consumption data safe transmission method
CN108990004A (en) * 2018-08-06 2018-12-11 上海保资智能科技有限公司 A kind of the display information transferring method and system of electronics price tag
CN109190727A (en) * 2018-08-06 2019-01-11 上海保资智能科技有限公司 A kind of the display information amending method and system of electronics price tag
CN109788510A (en) * 2019-01-25 2019-05-21 雅量商业智能技术(广州)有限公司 A kind of method for realizing low power consumption of electronics price tag system
CN111507466A (en) * 2019-01-30 2020-08-07 北京沃东天骏信息技术有限公司 Data processing method and device, electronic equipment and readable medium
CN112149450A (en) * 2019-06-26 2020-12-29 浙江汉朔电子科技有限公司 Noodle arrangement inspection system and method

Also Published As

Publication number Publication date
CN112929334A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
CN108572764B (en) Character input control method and device and computer readable storage medium
CN107730303B (en) Advertisement pushing method and device and computer readable storage medium
CN107547741B (en) Information processing method and device and computer readable storage medium
CN109840444B (en) Code scanning identification method, equipment and computer readable storage medium
CN107480054B (en) Call chain data processing method and device and computer readable storage medium
CN112597115A (en) Container mirror image compression method and device, terminal equipment and medium
CN109976859B (en) Screenshot method, terminal and computer readable storage medium
CN109445945B (en) Memory allocation method of application program, mobile terminal, server and storage medium
CN109711830B (en) Quick display method and device for two-dimension code payment, mobile terminal and storage medium
CN112437472B (en) Network switching method, equipment and computer readable storage medium
CN112105057B (en) Method and equipment for locally brushing electronic price tag and computer readable storage medium
CN111970738A (en) Network switching control method, equipment and computer readable storage medium
CN109683796B (en) Interaction control method, equipment and computer readable storage medium
CN108667714B (en) Information transmitting method, information receiving method, mobile terminal and storage medium
CN110955397A (en) Method for setting frame rate of game terminal, game terminal and storage medium
CN112929334B (en) Data transmission method, terminal and storage medium
CN112887776B (en) Method, equipment and computer readable storage medium for reducing audio delay
CN112860206A (en) Method, terminal and storage medium for pushing electronic price tags
CN109656658B (en) Editing object processing method and device and computer readable storage medium
CN109379719B (en) Application program broadcast processing method and device and computer readable storage medium
CN113326304A (en) Query method, mobile terminal and storage medium
CN113485667A (en) Method for screen projection display of terminal, terminal and storage medium
CN108304268B (en) Memory optimization method, mobile terminal and computer readable storage medium
CN108279985B (en) Interface request protocol transformation method, equipment and computer readable storage medium
CN112383905B (en) Radio frequency module processing method, terminal and computer readable storage medium

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