CN114070892A - Data transmission method and device - Google Patents
Data transmission method and device Download PDFInfo
- Publication number
- CN114070892A CN114070892A CN202111416823.9A CN202111416823A CN114070892A CN 114070892 A CN114070892 A CN 114070892A CN 202111416823 A CN202111416823 A CN 202111416823A CN 114070892 A CN114070892 A CN 114070892A
- Authority
- CN
- China
- Prior art keywords
- structure information
- definition structure
- data
- serialized data
- data definition
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 230000005540 biological transmission Effects 0.000 title claims abstract description 62
- 238000012545 processing Methods 0.000 claims abstract description 39
- 238000012795 verification Methods 0.000 claims description 26
- 238000004891 communication Methods 0.000 abstract description 15
- 230000006870 function Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 10
- 230000000694 effects Effects 0.000 description 7
- 230000001360 synchronised effect Effects 0.000 description 5
- 230000003190 augmentative effect Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000007599 discharging Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Abstract
The application discloses a data transmission method and a data transmission device, and belongs to the technical field of communication. The method comprises the following steps: determining serialized data definition structure information according to the object data; sending a first message to a second electronic device; to cause the second electronic device to obtain the serialized data definition structure information based on the first message; serializing the object data based on the serialized data definition structure information to obtain byte stream data; and sending the byte stream data to the second electronic equipment so that the second electronic equipment carries out deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data.
Description
Technical Field
The present application belongs to the field of communication technologies, and in particular, to a data transmission method and apparatus.
Background
With the development of communication technology, the transmission amount of application data supported by a terminal device is also increasing, and the requirements on the complexity and data size of various types of data structures are also increasing. However, the memory, bandwidth and performance of the terminal device are not comparable to those of the server cluster, so that how to efficiently transmit various heterogeneous serial number data is important.
In the existing scheme, a sending end and a receiving end in communication simultaneously store the same serialized data definition structure (schema), and in the process of data communication and transmission, the sending end converts object data into byte stream data through the serialized data definition structure and then sends the byte stream data to the receiving end; and after receiving the byte stream data, the receiving end analyzes the byte stream data according to the stored serialized data definition structure and deserializes the byte stream data into object data.
Because the serialized data definition structure is bound in the application program, for the application program with a complex data structure, the serialized data definition structure can occupy a large amount of storage space and loading space of the application program, and the loading performance of the application program is poor.
Disclosure of Invention
An object of the embodiments of the present application is to provide a data transmission method and apparatus, which can improve the problem of poor loading performance of an application program, and save a storage space and a loading space of the application program.
In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to a first electronic device, and the method includes:
determining serialized data definition structure information according to the object data;
sending a first message to a second electronic device; to cause the second electronic device to obtain the serialized data definition structure information based on the first message;
serializing the object data based on the serialized data definition structure information to obtain byte stream data;
and sending the byte stream data to the second electronic equipment so that the second electronic equipment carries out deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data.
In a second aspect, an embodiment of the present application provides a data transmission method, which is applied to a second electronic device, and the method includes:
receiving a first message from a first electronic device;
acquiring serialized data definition structure information according to the first message;
receiving byte stream data from the first electronic device;
deserializing the byte stream data based on the serialized data definition structure information to obtain object data;
deleting the serialized data definition structure information.
In a third aspect, an embodiment of the present application provides a data transmission apparatus, which is disposed in a first electronic device, and includes:
a determining module for determining serialized data definition structure information from the object data;
the sending module is used for sending a first message to the second electronic equipment; to cause the second electronic device to obtain the serialized data definition structure information based on the first message;
the processing module is used for carrying out serialization processing on the object data based on the serialization data definition structure information to obtain byte stream data;
the sending module is further configured to: and sending the byte stream data to the second electronic equipment so that the second electronic equipment carries out deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data.
In a fourth aspect, an embodiment of the present application provides a data transmission apparatus, which is disposed in a second electronic device, and includes:
the receiving module is used for receiving a first message from first electronic equipment;
the acquisition module is used for acquiring the serialized data definition structure information according to the first message;
the receiving module is further used for receiving byte stream data from the first electronic equipment;
the processing module is used for performing deserialization processing on the byte stream data based on the serialized data definition structure information to obtain object data;
and the deleting module is used for deleting the serialized data definition structure information.
In a fifth aspect, the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect or the second aspect.
In a sixth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first or second aspect.
In a seventh aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect or the second aspect.
In an eighth aspect, embodiments of the present application provide a computer program product, stored on a storage medium, for execution by at least one processor to implement the method according to the first aspect.
In the embodiment of the present application, the structural information is defined by determining serialized data from object data; sending a first message to a second electronic device; to cause the second electronic device to obtain the serialized data definition structure information based on the first message; serializing the object data based on the serialized data definition structure information to obtain byte stream data; and sending the byte stream data to the second electronic equipment so that the second electronic equipment carries out deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data. Therefore, under the condition that the serialized data needs to be transmitted, the serialized data definition structure information is obtained from the cloud server, and the serialized data definition structure information is dynamically deleted after the transmission is completed, so that the storage space and the loading space of the application program are saved, and the loading performance of the application program is improved.
Drawings
Fig. 1 is a schematic flow chart of a data transmission method according to an embodiment of the present application;
fig. 2 is a schematic flow chart of another data transmission method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another data transmission apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 6 is a schematic hardware structure diagram of an electronic device implementing an embodiment of the present application;
FIG. 7 is a schematic structural diagram of another electronic device according to an embodiment of the present application;
fig. 8 is a schematic hardware structure diagram of another electronic device for implementing the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The data transmission method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Fig. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present application. The data transmission method of the embodiment of the application can be executed by a data transmission device, for example, and the data transmission device can be disposed in a first electronic device such as a smart phone, a tablet computer, and a smart watch.
As shown in fig. 1, the data transmission method of this embodiment may include the following steps 1100 to 1400:
at step 1100, serialized data definition structure information is determined from the object data.
In this embodiment, since the object data and the serialized data definition structure based on the serialized communication belong to different types of information representations, and both can be converted into byte stream data for transparent transmission based on the communication protocol, the object data part and the serialized data definition structure part are separated, the serialized data definition structure part is removed from the storage of the application program, and is acquired from the cloud server when necessary, so that the storage space of the application program can be saved.
Specifically, in a case that serialized communication is required, the first electronic device may determine serialized data definition structure information according to object data of the serialized communication, in this embodiment, the serialized data definition structure information may be acquired from a cloud server, and after acquiring the serialized data definition structure information, the first electronic device may further verify the serialized data definition structure information to obtain a verification result; and determining that the operating environment is in a normal operating state according to the verification result.
Specifically, the serialized data definition structure is generally expressed in the form of a dynamic library or a class library, and the verification of the serialized data definition structure information may specifically be that the dynamic library is loaded or the class library is reflected to verify that the operating environment is in a normal operating state.
Optionally, the first electronic device may carry the serialized data definition structure information in the first message and send the first message to the second electronic device, or may also carry indication information used for indicating the second electronic device to acquire the serialized data definition structure information from a cloud server. This embodiment is not particularly limited thereto.
Step 1400, sending the byte stream data to the second electronic device, so that the second electronic device performs deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data.
Optionally, after this step, the first electronic device may further select to delete the serialized data definition structure information, so as to release a storage space occupied by the serialized data definition structure information.
According to the data transmission method, the serialized data definition structure information is determined according to the object data; sending a first message to a second electronic device; to cause the second electronic device to obtain the serialized data definition structure information based on the first message; serializing the object data based on the serialized data definition structure information to obtain byte stream data; and sending the byte stream data to the second electronic equipment so that the second electronic equipment carries out deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data. Therefore, under the condition that the serialized data needs to be transmitted, the serialized data definition structure information is obtained, and the serialized data definition structure information is dynamically deleted after the transmission is completed, so that the storage space and the loading space of the application program are saved, and the loading performance of the application program is improved.
Fig. 2 is a schematic flow chart of another data transmission method according to an embodiment of the present application. The data transmission method of the embodiment of the application may be executed by a data transmission device, for example, and the data transmission device may be disposed in a second electronic device, such as a smart phone, a tablet computer, and a smart watch.
As shown in fig. 2, the data transmission method of this embodiment may include the following steps 2100 to 2500:
at step 2100, a first message is received from a first electronic device.
The first message may carry serialized data definition structure information, or the first message may carry indication information for indicating the second electronic device to acquire the serialized data definition structure information from a cloud server. And is not particularly limited herein.
Step 2200, obtaining the serialized data definition structure information according to the first message.
Specifically, under the condition that the first message carries the serialized data definition structure information, the second electronic device may directly obtain the serialized data definition structure information carried in the first message. In a case that the indication information is carried in the first message, the second electronic device may obtain the serialized data definition structure information from a cloud server according to the indication information carried in the first message.
Further, after the serialized data definition structure information is acquired, the second electronic device can also verify the serialized data definition structure information to obtain a verification result; and determining that the operating environment is in a normal operating state according to the verification result.
Specifically, the serialized data definition structure is generally expressed in the form of a dynamic library or a class library, and the verification of the serialized data definition structure information may specifically be that the dynamic library is loaded or the class library is reflected to verify that the operating environment is in a normal operating state.
After acquiring the serialized data definition structure information, step 2300 is executed:
And 2400, performing deserialization processing on the byte stream data based on the serialized data definition structure information to obtain object data.
It can be understood that, after the object data is obtained, the second electronic device may perform a corresponding operation based on the obtained object data, which is not described herein again.
And 2500, deleting the serialized data definition structure information.
In this embodiment, after obtaining the object data, the second electronic device may delete the serialized data definition structure information to release the storage space occupied by the serialized data definition structure information.
According to the data transmission method, the first message from the first electronic device is received, and the serialized data definition structure information is obtained according to the first message; receiving byte stream data from first electronic equipment, and performing deserialization processing on the byte stream data based on the serialized data definition structure information to obtain object data; deleting the serialized data definition structure information. Therefore, under the condition that the serialized data needs to be transmitted, the serialized data definition structure information is obtained, and the serialized data definition structure information is dynamically deleted after the transmission is completed, so that the storage space and the loading space of the application program are saved, and the loading performance of the application program is improved.
It should be noted that, in the data transmission method provided in the embodiment of the present application, the execution main body may be a data transmission device, or a control module in the data transmission device for executing the data transmission method. In the embodiment of the present application, a data transmission method performed by a data transmission device is taken as an example, and the data transmission device provided in the embodiment of the present application is described.
Fig. 3 is a schematic structural diagram of a data transmission device according to an embodiment of the present application. As shown in fig. 3, the data transmission device 3000 of the embodiment of the present application may include: a determination module 3100, a sending module 3200, and a processing module 3300.
The determination module 3100 is configured to determine the serialized data definition structure information from the object data.
A sending module 3200 for sending a first message to a second electronic device; to cause the second electronic device to obtain the serialized data definition structure information based on the first message.
The processing module 3300 is configured to perform serialization processing on the object data based on the serialization data definition structure information to obtain byte stream data.
The sending module 3200 is further configured to: and sending the byte stream data to the second electronic equipment so that the second electronic equipment carries out deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data.
In one embodiment, the apparatus further comprises a deletion module for deleting the serialized data definition structure information.
In one embodiment, the apparatus further includes a verification module, configured to verify the serialized data definition structure information to obtain a verification result; and determining that the operating environment is in a normal operating state according to the verification result.
The data transmission device of the embodiment is provided with a determining module for determining the serialized data definition structure information according to the object data; the first message is sent to the second electronic equipment; a sending module for enabling the second electronic device to obtain the serialized data definition structure information based on the first message, and sending the byte stream data to the second electronic device; and the processing module is used for carrying out serialization processing on the object data based on the serialization data definition structure information to obtain byte stream data. Therefore, under the condition that the serialized data needs to be transmitted, the serialized data definition structure information is obtained, and the serialized data definition structure information is dynamically deleted after the transmission is completed, so that the storage space and the loading space of the application program are saved, and the loading performance of the application program is improved.
The data transmission device in the embodiment of the present application may be an electronic device, and may also be a component in the electronic device, such as an integrated circuit, or a chip. The electronic device may be a terminal, or may be a device other than a terminal. The terminal may be, for example, a Mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited in particular.
The data transmission device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The data transmission device provided in the embodiment of the present application can implement each process implemented in the method embodiment of fig. 1, and is not described here again to avoid repetition.
Fig. 4 is a schematic structural diagram of another data transmission device according to an embodiment of the present application. As shown in fig. 4, a data transmission device 4000 according to an embodiment of the present application may include: the apparatus includes a receiving module 4100, an obtaining module 4200, a processing module 4300, and a deleting module 4400.
The receiving module 4100 is configured to receive a first message from a first electronic device.
An obtaining module 4200, configured to obtain the serialized data definition structure information according to the first message.
The receiving module 4100 is further configured to receive byte stream data from the first electronic device.
The processing module 4300 is configured to perform deserialization processing on the byte stream data based on the serialized data definition structure information to obtain object data.
An deleting module 4400 is configured to delete the serialized data definition structure information.
In one embodiment, the obtaining module 4200 is specifically configured to: acquiring the serialized data definition structure information from a cloud server according to the indication information carried in the first message; or acquiring the serialized data definition structure information carried in the first message.
In one embodiment, the apparatus further includes a verification module, configured to verify the serialized data definition structure information to obtain a verification result; and determining that the operating environment is in a normal operating state according to the verification result.
The data transmission device of the embodiment comprises a receiving module, a first processing module and a second processing module, wherein the receiving module is used for receiving a first message and byte stream data from a first electronic device; the processing module is used for performing deserialization processing on the byte stream data based on the serialized data definition structure information to obtain object data; and a deletion module for deleting the serialized data definition structure information. Therefore, under the condition that the serialized data needs to be transmitted, the serialized data definition structure information is obtained, and the serialized data definition structure information is dynamically deleted after the transmission is completed, so that the storage space and the loading space of the application program are saved, and the loading performance of the application program is improved.
The data transmission device in the embodiment of the present application may be an electronic device, and may also be a component in the electronic device, such as an integrated circuit, or a chip. The electronic device may be a terminal, or may be a device other than a terminal. The terminal may be, for example, a Mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited in particular.
The data transmission device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The data transmission device provided in the embodiment of the present application can implement each process implemented in the method embodiment of fig. 2, and is not described here again to avoid repetition.
Optionally, as shown in fig. 5, an electronic device 5000 according to an embodiment of the present application is further provided, and includes a processor 5100, a memory 5200, where the memory 5200 stores a program or an instruction that can be executed on the processor 5100, and when the program or the instruction is executed by the processor 5100, the steps of the data transmission method embodiment shown in fig. 1 are implemented, and the same technical effects can be achieved, and are not repeated here to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device described above.
Fig. 6 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and the like.
Those skilled in the art will appreciate that the electronic device 600 may further comprise a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 610 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 6 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
Wherein the processor 610 is configured to determine serialized data definition structure information from the object data; sending a first message to a second electronic device; to cause the second electronic device to obtain the serialized data definition structure information based on the first message; serializing the object data based on the serialized data definition structure information to obtain byte stream data; and sending the byte stream data to the second electronic equipment so that the second electronic equipment carries out deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data.
In one embodiment, the processor 610 is further configured to delete the serialized data definition structure information.
In one embodiment, the processor 610 is further configured to verify the serialized data definition structure information to obtain a verification result; and determining that the operating environment is in a normal operating state according to the verification result.
The electronic device of the embodiment of the application can be used for executing the technical scheme of the embodiment of the method, and the implementation principle and the technical effect are similar, which are not described herein again.
It is to be understood that, in the embodiment of the present application, the input Unit 604 may include a Graphics Processing Unit (GPU) 6041 and a microphone 6042, and the Graphics Processing Unit 6041 processes image data of a still picture or a video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. A touch panel 6071, also referred to as a touch screen. The touch panel 6071 may include two parts of a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 609 may be used to store software programs as well as various data. The memory 609 may mainly include a first storage area storing a program or an instruction and a second storage area storing data, wherein the first storage area may store an operating system, an application program or an instruction (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 609 may include volatile memory or nonvolatile memory, or the memory 609 may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. The volatile Memory may be a Random Access Memory (RAM), a Static Random Access Memory (Static RAM, SRAM), a Dynamic Random Access Memory (Dynamic RAM, DRAM), a Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, ddr SDRAM), an Enhanced Synchronous SDRAM (ESDRAM), a Synchronous Link DRAM (SLDRAM), and a Direct Memory bus RAM (DRRAM). The memory 609 in the embodiments of the subject application include, but are not limited to, these and any other suitable types of memory.
Optionally, as shown in fig. 7, an electronic device 7000 according to an embodiment of the present application is further provided, and includes a processor 7100, a memory 7200, where the memory 7200 stores a program or an instruction that can be executed on the processor 7100, and when the program or the instruction is executed by the processor 7100, the steps of the data transmission method embodiment shown in fig. 2 are implemented, and the same technical effects can be achieved, and are not described again here to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device described above.
Fig. 8 is a schematic hardware structure diagram of another electronic device for implementing the embodiment of the present application.
The electronic device 800 includes, but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810.
Those skilled in the art will appreciate that the electronic device 800 may further comprise a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 810 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system. The electronic device structure shown in fig. 8 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
Wherein the processor 810 is configured to receive a first message from a first electronic device; acquiring serialized data definition structure information according to the first message; receiving byte stream data from the first electronic device; deserializing the byte stream data based on the serialized data definition structure information to obtain object data; deleting the serialized data definition structure information.
In an embodiment, the processor 810 is specifically configured to obtain the serialized data definition structure information from a cloud server according to the indication information carried in the first message; or acquiring the serialized data definition structure information carried in the first message.
In one embodiment, the processor 810 is further configured to verify the serialized data definition structure information to obtain a verification result; and determining that the operating environment is in a normal operating state according to the verification result.
The electronic device of the embodiment of the application can be used for executing the technical scheme of the embodiment of the method, and the implementation principle and the technical effect are similar, which are not described herein again.
It should be understood that in the embodiment of the present application, the input Unit 804 may include a Graphics Processing Unit (GPU) 8041 and a microphone 8042, and the Graphics Processing Unit 8041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. A touch panel 8071, also referred to as a touch screen. The touch panel 8071 may include two portions of a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 809 may be used to store software programs as well as various data. The memory 809 may mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playing function, an image playing function, and the like), and the like. Further, the memory 809 can include volatile memory or nonvolatile memory, or the memory 809 can include both volatile and nonvolatile memory. The non-volatile memory may be a ROM, PROM, EPROM, EEPROM, or flash memory, among others. The volatile memory may be RAM, SRAM, DRAM, SDRAM, DDRSDRAM, ESDRAM, SLDRAM, and DRRAM. The memory 809 in the present embodiment of the application includes, but is not limited to, these and any other suitable types of memory.
An embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the data transmission method embodiment shown in fig. 1 or fig. 2, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the data transmission method embodiment shown in fig. 1 or fig. 2, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
Embodiments of the present application provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method as described aboveData transmissionThe processes of the method embodiment can achieve the same technical effect, and are not described herein again to avoid repetition.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (12)
1. A data transmission method is applied to first electronic equipment, and is characterized by comprising the following steps:
determining serialized data definition structure information according to the object data;
sending a first message to a second electronic device; to cause the second electronic device to obtain the serialized data definition structure information based on the first message;
serializing the object data based on the serialized data definition structure information to obtain byte stream data;
and sending the byte stream data to the second electronic equipment so that the second electronic equipment carries out deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data.
2. The method of claim 1, wherein after the sending the byte stream data to the second electronic device, the method further comprises:
deleting the serialized data definition structure information.
3. The method of claim 1, wherein after determining the serialized data definition structure information from the object data, the method further comprises:
verifying the serialized data definition structure information to obtain a verification result;
and determining that the operating environment is in a normal operating state according to the verification result.
4. A data transmission method is applied to a second electronic device, and is characterized by comprising the following steps:
receiving a first message from a first electronic device;
acquiring serialized data definition structure information according to the first message;
receiving byte stream data from the first electronic device;
deserializing the byte stream data based on the serialized data definition structure information to obtain object data;
deleting the serialized data definition structure information.
5. The method of claim 4, wherein obtaining serialized data definition structure information from the first message comprises:
acquiring the serialized data definition structure information from a cloud server according to the indication information carried in the first message; alternatively, the first and second electrodes may be,
and acquiring the definition structure information of the serialized data carried in the first message.
6. The method of claim 4, wherein after obtaining serialized data definition structure information from the first message, the method further comprises:
verifying the serialized data definition structure information to obtain a verification result;
and determining that the operating environment is in a normal operating state according to the verification result.
7. A data transmission device is arranged on a first electronic device, and is characterized by comprising:
a determining module for determining serialized data definition structure information from the object data;
the sending module is used for sending a first message to the second electronic equipment; to cause the second electronic device to obtain the serialized data definition structure information based on the first message;
the processing module is used for carrying out serialization processing on the object data based on the serialization data definition structure information to obtain byte stream data;
the sending module is further configured to: and sending the byte stream data to the second electronic equipment so that the second electronic equipment carries out deserialization processing on the byte stream data based on the serialized data definition structure information to obtain the object data.
8. The apparatus of claim 7, further comprising:
and the deleting module is used for deleting the serialized data definition structure information.
9. The apparatus of claim 7, further comprising:
the verification module is used for verifying the serialized data definition structure information to obtain a verification result; and determining that the operating environment is in a normal operating state according to the verification result.
10. A data transmission device is arranged on a second electronic device, and is characterized by comprising:
the receiving module is used for receiving a first message from first electronic equipment;
the acquisition module is used for acquiring the serialized data definition structure information according to the first message;
the receiving module is further used for receiving byte stream data from the first electronic equipment;
the processing module is used for performing deserialization processing on the byte stream data based on the serialized data definition structure information to obtain object data;
and the deleting module is used for deleting the serialized data definition structure information.
11. The apparatus of claim 10, wherein the obtaining module is specifically configured to:
acquiring the serialized data definition structure information from a cloud server according to the indication information carried in the first message; alternatively, the first and second electrodes may be,
and acquiring the definition structure information of the serialized data carried in the first message.
12. The apparatus of claim 10, further comprising:
the verification module is used for verifying the serialized data definition structure information to obtain a verification result; and determining that the operating environment is in a normal operating state according to the verification result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111416823.9A CN114070892A (en) | 2021-11-25 | 2021-11-25 | Data transmission method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111416823.9A CN114070892A (en) | 2021-11-25 | 2021-11-25 | Data transmission method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114070892A true CN114070892A (en) | 2022-02-18 |
Family
ID=80276280
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111416823.9A Pending CN114070892A (en) | 2021-11-25 | 2021-11-25 | Data transmission method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114070892A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023179632A1 (en) * | 2022-03-21 | 2023-09-28 | 华为技术有限公司 | Data processing method and apparatus |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130247003A1 (en) * | 2012-03-14 | 2013-09-19 | Microsoft Corporation | Using grammar to serialize and de-serialize objects |
CN108427691A (en) * | 2017-02-15 | 2018-08-21 | 腾讯科技(深圳)有限公司 | Network data transmission method, device and computer equipment |
CN108595209A (en) * | 2018-03-21 | 2018-09-28 | 百度在线网络技术(北京)有限公司 | Data store and read method, device, system and storage medium |
CN109121218A (en) * | 2017-06-22 | 2019-01-01 | 深圳市金立通信设备有限公司 | A kind of data transmission method, device, base station and user equipment |
CN110597500A (en) * | 2019-07-26 | 2019-12-20 | 北京柠檬微趣科技股份有限公司 | Method and device for serialization and deserialization of message structure |
-
2021
- 2021-11-25 CN CN202111416823.9A patent/CN114070892A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130247003A1 (en) * | 2012-03-14 | 2013-09-19 | Microsoft Corporation | Using grammar to serialize and de-serialize objects |
CN108427691A (en) * | 2017-02-15 | 2018-08-21 | 腾讯科技(深圳)有限公司 | Network data transmission method, device and computer equipment |
CN109121218A (en) * | 2017-06-22 | 2019-01-01 | 深圳市金立通信设备有限公司 | A kind of data transmission method, device, base station and user equipment |
CN108595209A (en) * | 2018-03-21 | 2018-09-28 | 百度在线网络技术(北京)有限公司 | Data store and read method, device, system and storage medium |
CN110597500A (en) * | 2019-07-26 | 2019-12-20 | 北京柠檬微趣科技股份有限公司 | Method and device for serialization and deserialization of message structure |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023179632A1 (en) * | 2022-03-21 | 2023-09-28 | 华为技术有限公司 | Data processing method and apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112257135B (en) | Model loading method and device based on multithreading, storage medium and terminal | |
US20190107929A1 (en) | Method and device for loading content of page, and electronic device | |
CN114780615A (en) | Error code management method and device thereof | |
CN114070892A (en) | Data transmission method and device | |
CN113282239A (en) | Data migration method, memory and controller | |
CN110321321B (en) | Snapshot read-write method, device and equipment for network block equipment and storage medium | |
CN111399819A (en) | Data generation method and device, electronic equipment and storage medium | |
CN111817944A (en) | Picture sharing method and device and electronic equipment | |
CN111444117A (en) | Method and device for realizing fragmentation of storage space, storage medium and electronic equipment | |
CN115495020A (en) | File processing method and device, electronic equipment and readable storage medium | |
CN112073505B (en) | Method for unloading on cloud server, control device and storage medium | |
CN113391860B (en) | Service request processing method and device, electronic equipment and computer storage medium | |
CN110262856B (en) | Application program data acquisition method, device, terminal and storage medium | |
CN114564921A (en) | Document editing method and device | |
CN114285957A (en) | Image processing circuit and data transmission method | |
CN116456131B (en) | Special effect rendering method and device, electronic equipment and storage medium | |
CN115766968A (en) | Image processing system and method thereof | |
CN110858146B (en) | Data processing method, apparatus and machine readable medium | |
CN116302807A (en) | System, method, electronic device and storage medium for monitoring device memory | |
CN114217748A (en) | Data export method, device, equipment, medium and product | |
CN116450439A (en) | Lookup table testing method and device and electronic equipment | |
CN115202766A (en) | Terminal control method and device | |
CN114706635A (en) | Application program logic processing method, device and equipment | |
CN114253449A (en) | Screen capturing method, device, equipment and medium | |
CN116954462A (en) | Configuration method and device of input device and electronic device |
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 |