Data transmission method and apparatus, electronic device, and computer-readable storage medium
Patent Information
- Application Number
- CN202210016496.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-07
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-01-07
AI Technical Summary
[0044]在本申请实施例提供的数据传输方法中,由于预设数据结构协议为按照至少一个数据字段进行数据存储,预构建的数据存储区域中预存储的数据是根据该预设数据结构协议进行存储的,响应于来自发送方的数据获取请求,确定对应于该数据获取请求的目标数据字段之后,可以直接从预构建的数据存储区域中获取对应于目标数据字段的目标数据,并将该目标数据发送至发送方,以使得发送方依据该目标数据字段对目标数据进行处理。
Smart Images

Figure CN116455969B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of cloud technology, blockchain, and communication technology. Specifically, this application relates to a data transmission method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] With the development of science and technology, there are increasingly more network data exchange processes in the fields of computers and the Internet. Given limited network resources, how to effectively transmit data and reduce overhead during data transmission is a pressing technical problem that needs to be solved.
[0003] In related technologies, the data object is usually serialized into a transmittable byte sequence at one end of the data transmission, and then transmitted to the other end of the data transmission via a network transmission protocol. At the other end of the data transmission, the byte sequence is deserialized into a data object to complete the entire data transmission process. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for data transmission. The technical problem to be solved by this method is how to reduce the overhead during data transmission.
[0005] According to one aspect of the embodiments of this application, a data transmission method is provided, the method comprising:
[0006] In response to a data retrieval request from the sender, determine the target data field corresponding to the data retrieval request;
[0007] Retrieve target data corresponding to the target data field from a pre-built data storage area. The data storage area pre-stores data stored according to a preset data structure protocol, which includes data storage according to at least one data field.
[0008] The target data is sent to the sender so that the sender can process the target data based on the target data fields.
[0009] According to another aspect of the embodiments of this application, a data transmission method is provided, the method comprising:
[0010] In response to a data processing request, a data retrieval request is generated, which includes the target data field;
[0011] Send a data retrieval request to the recipient so that the recipient can retrieve the target data corresponding to the target data field in the pre-built data storage area based on the target data field;
[0012] Obtain the target data fed back by the recipient, and execute a data processing request on the target data based on the target data fields.
[0013] According to another aspect of the embodiments of this application, a data transmission apparatus is provided, the apparatus comprising a target data field determination module, a target data acquisition module, and a transmission module:
[0014] The target data field determination module is used to determine the target data field corresponding to the data acquisition request in response to the data acquisition request from the sender.
[0015] The target data acquisition module is used to acquire target data corresponding to the target data field from a pre-built data storage area. The data storage area pre-stores data stored according to a preset data structure protocol. The preset data structure protocol includes data storage according to at least one data field.
[0016] The sending module is used to send the target data to the sender, so that the sender can process the target data according to the target data fields.
[0017] Optionally, the data to be stored corresponds to at least two data objects, each data object including at least two data fields, and the device further includes a storage module.
[0018] A storage module is used to store at least two data objects belonging to the same data field into the same sub-area of the data storage area;
[0019] Specifically, when the target data acquisition module retrieves the target data corresponding to the target data field from the pre-built data storage area, it is used for:
[0020] In the data storage area, identify the target sub-region corresponding to the target data field;
[0021] Retrieve target data from the target sub-region.
[0022] Optionally, the device further includes a target network transmission mode determination module.
[0023] The target network transmission mode determination module is used to determine the target network transmission mode corresponding to the data acquisition request in response to the data acquisition request.
[0024] Specifically, when sending target data to the sender, the sending module is used for:
[0025] The target data is sent to the sender via the target network transmission mode.
[0026] According to another aspect of the embodiments of this application, a data transmission apparatus is provided, the apparatus comprising:
[0027] The data acquisition request generation module is used to generate a data acquisition request in response to a data processing request. The data acquisition request includes the target data field.
[0028] The data acquisition request sending module is used to send data acquisition requests to the receiver, so that the receiver can obtain the target data corresponding to the target data field in the pre-built data storage area based on the target data field;
[0029] The target data acquisition module is used to acquire the target data fed back by the receiver and to perform data processing requests on the target data based on the target data fields.
[0030] Optionally, the device further includes an acquisition module and a target network transmission mode determination module.
[0031] The acquisition module is used to acquire network attribute information of the network between the receiver and the sender, including data transmission frequency.
[0032] The target network transmission mode determination module is used to determine the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request.
[0033] When sending a data acquisition request to the recipient, the data acquisition request sending module is specifically used for:
[0034] The data acquisition request is sent to the recipient through the target network transmission mode.
[0035] Optionally, the target network transmission mode includes any one of the following: REST network transmission mode, RPC network transmission mode, and socket network transmission mode;
[0036] The target network transmission mode determination module determines the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request, including:
[0037] If the data transmission frequency is less than the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be the REST network transmission mode.
[0038] If the data transmission frequency is greater than or equal to the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be the RPC network transmission mode.
[0039] If the data volume is greater than or equal to the second preset threshold, the target network transmission mode is determined to be the socket network transmission mode.
[0040] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.
[0041] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described method.
[0042] According to another aspect of the embodiments of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0043] The beneficial effects of the technical solutions provided in this application are:
[0044] In the data transmission method provided in this application embodiment, since the preset data structure protocol stores data according to at least one data field, the data pre-stored in the pre-built data storage area is stored according to the preset data structure protocol. In response to a data acquisition request from the sender, after determining the target data field corresponding to the data acquisition request, the target data corresponding to the target data field can be directly obtained from the pre-built data storage area and sent to the sender so that the sender can process the target data according to the target data field.
[0045] By directly transmitting the target data corresponding to the target data field, platforms (sender and receiver) do not need to process other data in the data object containing the target data field besides the target data field, reducing the overhead of serialization and deserialization between platforms. Furthermore, since the target data corresponding to the target data field is transmitted during network transmission, rather than the data object corresponding to the target data field, network transmission overhead can also be saved. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0047] Figure 1 This paper illustrates a data storage architecture diagram of a data transmission system provided in an embodiment of this application.
[0048] Figure 2 This paper illustrates a data transmission architecture diagram of a data transmission system provided in an embodiment of this application.
[0049] Figure 3 A flowchart of the data transmission system provided in an embodiment of this application is shown;
[0050] Figure 4 A schematic diagram of the data storage area corresponding to platform 1 in this application embodiment is shown;
[0051] Figure 5 This diagram illustrates the data storage architecture of a data transmission system in the relevant art.
[0052] Figure 6 This paper illustrates another data transmission architecture diagram of the data transmission system provided in an embodiment of this application;
[0053] Figure 7 Another flowchart of the data transmission method provided in an embodiment of this application is shown;
[0054] Figure 8 A flowchart of another data transmission method provided in an embodiment of this application is shown;
[0055] Figure 9 An architecture diagram of the data transmission system provided in an embodiment of this application is shown;
[0056] Figure 10 This paper illustrates a data storage architecture diagram of a data transmission system provided in an embodiment of this application.
[0057] Figure 11 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application;
[0058] Figure 12 This is a schematic diagram of another data transmission device provided in an embodiment of this application;
[0059] Figure 13 A schematic diagram of the structure of an electronic device to which this application embodiment applies is shown. Detailed Implementation
[0060] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0061] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.”
[0062] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0063] The following explains the terminology and related technologies involved in this application:
[0064] Memory model: Binary data based on computer memory.
[0065] Serialization: The process of converting the state information of an object into a form (byte stream) that can be stored or transmitted.
[0066] Deserialization: The reverse process of serialization, which converts a byte stream back into the original object.
[0067] Serialization allows you to write the current state of an object to temporary or persistent storage. The object can then be recreated by reading its state from or deserializing it. Serialization and deserialization can be implemented using JSON (JavaScript Object Notation) or XML (Extensible Markup Language).
[0068] A socket is an endpoint for bidirectional communication between application processes on different hosts on a network. It provides a communication mechanism between any two computers via TCP (Transmission Control Protocol). Specifically, a client program creates a socket and attempts to connect to the server's socket. When the connection is established, the server creates its own socket. The client and server can then communicate by writing to or reading objects from these sockets.
[0069] RPC (Remote Procedure Call): Allows a program on a remote computer to request services from a program on another computer without needing to understand the underlying network protocols. It enables a program running on one computer to call a subroutine on another computer without requiring the program to code the interaction.
[0070] REST (Representational State Transfer): Based on the HTTP protocol (Hypertext Transfer Protocol), it provides HTTP requests through HTTP methods such as POST, GET, PUT, and DELETE requests and a highly readable URL (Uniform Resource Locator).
[0071] A POST request represents a request to submit data to a specified resource for processing (such as submitting a form or uploading a file). The data is included in the request body. A POST request may result in the creation of a new resource and / or modification of an existing resource. A PUT request represents data sent from the client to the server that replaces the content of a specified document. A GET request represents a request for information about a specified page and returns an entity body. A DELETE request represents a request to the server to delete a specified page.
[0072] In related technologies, since different terminals store data in the form of data objects, and because the storage methods between terminals differ, the acquired data needs to be serialized into a format recognizable by each terminal before the data objects can be written to temporary or persistent storage. During data transmission between different terminals, the sender needs to generate a data retrieval request using the identifier of the target data object, serialize the data retrieval request into a byte stream, and send the serialized data retrieval request to the receiver. Upon receiving the serialized data retrieval request, the receiver deserializes the request, obtains the identifier of the target data object, accesses the data storage area, retrieves the target data object corresponding to the identifier, serializes the target data object into a byte stream, and sends it back to the sender. This allows the sender to deserialize the byte stream and write the deserialized target data object into temporary or persistent storage for data processing based on the target data object stored in that storage area.
[0073] However, in the data transmission methods of related technologies, when the sender only needs to obtain the target data belonging to the target data field from multiple data objects, the sender needs to deserialize the target data objects stored in the aforementioned temporary or persistent storage area to obtain the data field corresponding to each target data object, and then obtain the data corresponding to the target data field from the data field corresponding to each target data object before proceeding with the subsequent data processing.
[0074] Based on the above, in the communication methods provided in related technologies, when only data belonging to the target data field from multiple data objects needs to be obtained, all data fields of the multiple data objects, including the target data field, need to be serialized and deserialized, which causes unnecessary overhead for serialization and deserialization between platforms. Furthermore, during network transmission, transmitting all data fields of the multiple data objects, including the target data field, also increases the data overhead of network transmission.
[0075] To address at least one of the aforementioned technical problems or areas requiring improvement in related technologies, this application proposes a data transmission method, apparatus, electronic device, computer-readable storage medium, and computer program product. In this data transmission method, since the preset data structure protocol stores data according to at least one data field, the data pre-stored in the pre-constructed data storage area is stored according to this preset data structure protocol. In response to a data acquisition request from the sender, after determining the target data field corresponding to the data acquisition request, the target data corresponding to the target data field can be directly retrieved from the pre-constructed data storage area and sent to the sender, allowing the sender to process the target data based on the target data field. This method, by directly transmitting the target data corresponding to the target data field, eliminates the need for platforms to process other data in the data object containing the target data field besides the target data field, reducing the overhead of serialization and deserialization between platforms. Furthermore, since the target data corresponding to the target data field is transmitted during network transmission, rather than the data object corresponding to the target data field, network transmission overhead can also be saved.
[0076] Optionally, the data transmission method provided in this application embodiment can be implemented based on cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize data computation, storage, processing, and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology applied based on the cloud computing business model. It can form a resource pool, be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. The backend services of technical network systems require a large amount of computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the Internet industry, in the future, every item may have its own identification mark, which will need to be transmitted to the backend system for logical processing. Data of different levels will be processed separately, and various industry data will all require strong system support, which can only be achieved through cloud computing.
[0077] Cloud computing refers to the delivery and usage model of IT infrastructure, meaning obtaining necessary resources through the network in an on-demand and easily scalable manner. In a broader sense, cloud computing refers to the delivery and usage model of services, meaning obtaining necessary services through the network in an on-demand and easily scalable manner. These services can be IT and software, internet-related, or other services. Driven by the development of the internet, real-time data streams, the diversification of connected devices, and the demands of search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Unlike previous parallel distributed computing, the emergence of cloud computing will fundamentally revolutionize the entire internet model and enterprise management model.
[0078] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network to work together through application software or application interfaces to provide data storage and business access functions to the outside world.
[0079] Optionally, the data processing method provided in this application embodiment can also be implemented based on blockchain technology. Specifically, the data used in this data transmission method, such as data pre-stored in the data storage area according to a preset data structure protocol, can be stored on the blockchain.
[0080] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0081] Figure 1 A data storage architecture diagram of the data transmission system provided in an embodiment of this application is shown. Figure 2 A data transmission architecture diagram of the data transmission system provided in an embodiment of this application is shown. Figure 3 A flowchart of a data transmission system provided in an embodiment of this application is shown. Figure 4 A schematic diagram of the data storage area corresponding to platform 1 in this embodiment of the application is shown. Figure 1 As shown, all platforms store data using a pre-defined data structure protocol; this stored data is called protocol memory data (hereinafter referred to as "protocol data"). The specific method for storing protocol memory data is as follows: Figure 4 The "protocol data" shown, through the platform's CPU (Central Processing Unit) and data processing device, can store at least two data objects belonging to the same data field into the same sub-region of the data storage area, thus achieving continuous storage of data with the same data field between different data objects. The data processing device can be implemented using any programmable program.
[0082] Data transmission between Platform 1 and Platform 2 can be performed using any network transmission mode according to actual needs. For example... Figure 2As shown, network transmission modes can include REST network transmission mode, RPC network transmission mode, and socket network transmission mode.
[0083] like Figure 1 and Figure 2 As shown, each platform can be a server or a terminal. That is, this data transmission method can be applied to data transmission between terminals, between a terminal and a server, and between servers.
[0084] When a platform acts as a server, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0085] When a platform is used as a terminal, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and the server can be connected directly or indirectly through wired or wireless communication, and this application does not impose any restrictions.
[0086] like Figure 3 As shown, the stored data includes data object ①, data object ②, and data object ③. Data object ① includes k1 (corresponding to data field ①), v1 (corresponding to data field ②), and vv1 (corresponding to data field ③). Data object ② includes k2 (corresponding to data field ①), v2 (corresponding to data field ②), and vv2 (corresponding to data field ③). Data object ③ includes k3 (corresponding to data field ①), v3 (corresponding to data field ②), and vv3 (corresponding to data field ③).
[0087] When storing data according to relevant technologies, i.e. Figure 3 The "in-memory structure" indicates a storage method based on data objects, storing all data fields belonging to the same data object together. Each data object can be stored in a sub-region, which can be an independent or non-independent storage space, as long as it stores all data fields belonging to the same data object together. This method of storing together can be understood as contiguous storage. For example... Figure 3 As shown, all data fields of data object ①, corresponding to data k1, v1, and vv1, are stored together.
[0088] When storing data according to the scheme in the embodiments of this application, that is... Figure 3 The "protocol data" indicates a storage method based on data fields, grouping data belonging to the same data field from different data objects together. Each data field can be stored in a sub-region, which can be an independent storage space or a non-independent storage space, as long as it allows data belonging to the same data field from different data objects to be stored together. For example... Figure 3 As shown, the data k1, k2, and k3 corresponding to data field ① in different data objects are stored together.
[0089] The following example uses data transmission between Platform 1 and Platform 2, combined with... Figure 2 , Figure 3 The data transmission method provided in the embodiments of this application will be described in detail as follows:
[0090] Step S11: When Platform 2 needs to obtain the data corresponding to data field ② (that is, the target data field is data field 2, field ②) in order to perform further data processing on the data corresponding to data field ②, a data acquisition request can be generated based on the identifier of data field ②. That is, a data acquisition request is generated in response to the data processing request of Platform 2.
[0091] Step S12: Platform 2 obtains network attribute information of the network between Platform 1 and Platform 2, including data transmission frequency;
[0092] The target network transmission mode is determined based on the data transmission frequency and the amount of data indicated in the data processing request.
[0093] If the data transmission frequency is less than the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be the REST network transmission mode.
[0094] If the data transmission frequency is greater than or equal to the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be the RPC network transmission mode.
[0095] If the data volume is greater than or equal to the second preset threshold, the target network transmission mode is determined to be the socket network transmission mode.
[0096] In the REST network transmission mode, data transmission is performed using JSON as the default format. This means the transmitted data is converted to JSON format before transmission. In the RPC network transmission mode, data transmission can be completed by the client invoking a service (function or method) on the server via parameter passing and receiving the returned result. In the socket network transmission mode, the data transmission process can be completed through operations such as server creating a socket, client creating a socket, server binding the socket and port number, server listening on the port number, client connecting to the port, server receiving connection requests, client writing information (i.e., the content to be transmitted, such as the data acquisition request and target data in this embodiment) to the socket, server reading characters from the socket, client closing the socket, and server closing the socket.
[0097] In step S12, assuming the data transmission frequency is high and the data volume is small, the target network transmission mode can be selected as the RPC network transmission mode.
[0098] Step S13: Platform 2 sends the data acquisition request to the receiver through the determined target network transmission mode.
[0099] Step S14: In response to the data acquisition request, Platform 1 determines the field ② corresponding to the data acquisition request and the target network transmission mode corresponding to the data acquisition request, namely the RPC network transmission mode.
[0100] Step S15: Platform 1 retrieves the target data corresponding to field ② from the data storage area corresponding to Platform 1, i.e. Figure 3 The numbers “v1”, “v2”, and “v3” are shown.
[0101] Specifically, as described above, since continuous storage of data with the same data fields between different data objects is achieved in the data storage area corresponding to Platform 1, when Platform 1 determines the field ② corresponding to the data acquisition request, it can directly determine the target sub-region corresponding to field ② in its corresponding data storage area, and determine all data "v1", "v2" and "v3" corresponding to the target sub-region as the target data.
[0102] When each data field's sub-region is an independent storage space, accessing a sub-region corresponding to a data field allows you to identify all data within that sub-region as belonging to that data field. When each data field's sub-region is not an independent storage space, you can directly access all storage regions corresponding to all data fields, sequentially determining whether the currently accessed data matches the data for the desired data field. If so, the currently accessed data is used as the data for that data field, continuing until the accessed data is not the data for the desired data field. It's understandable that because data within the same data field is stored contiguously across different data objects, even if each data field's sub-region is not an independent storage space, stopping access to all storage regions when the accessed data is not the data for the desired data field will not result in any omissions of the required data.
[0103] Step S16: Platform 1 sends the target data “v1”, “v2” and “v3” directly to the sender according to the RPC network transmission mode.
[0104] Step S17: After receiving the target data from Platform 1, Platform 2 temporarily stores the target data in its corresponding data storage area and can process the target data based on the target data temporarily stored in the data storage area.
[0105] Figure 5 A data storage architecture diagram of a data transmission system in related technologies is shown. Figure 6 This illustration shows another data transmission architecture diagram of the data transmission system provided in an embodiment of this application. In related technologies, all data corresponding to different data objects are stored according to the different data objects, that is, Figure 4 The "in-memory structure" shown refers to data objects that each platform needs to store in its corresponding data format according to its recognizability. For example... Figure 5 As shown, when storing data, data objects need to be serialized, storing all data corresponding to the same data object together contiguously. For example... Figure 6 As shown, during data transmission, the serialized data object is transmitted as a byte stream. During data reading, the byte stream corresponding to the data object needs to be deserialized back into a data object.
[0106] If only data for the same data field corresponding to multiple objects is needed, such as the example above where only data "v1", "v2", and "v3" corresponding to field ② are needed, then when storing data according to the "in-memory structure", all data objects stored on platform 1 need to be serialized, and the serialized data needs to be transmitted to platform 2 in the form of a byte stream. Platform 2 deserializes the received serialized data to obtain all data objects corresponding to the data format that platform 2 can recognize, temporarily stores them in the corresponding data storage area of platform 2, and then retrieves the data corresponding to field ② from all data objects.
[0107] According to the data transmission methods provided in related technologies, serialization is required between platform 1 and platform 2. This necessitates setting up serialization and deserialization devices for both platforms, increasing the complexity and overhead of their setup. Furthermore, the time overhead for the entire data transmission process can be expressed as: (ts + td) * n + mTime * 2, where ts represents the serialization time, td represents the deserialization time, n represents the number of platforms, and mTime represents the network time for data exchange. Figure 6 As shown, assuming platform 1 and platform 2 transmit data via REST network transmission mode, the time overhead required during data transmission is (ts+td)*2+restTime*2. Furthermore, when only data from a specific data field needs to be retrieved, the data transmission process requires serializing and deserializing all data objects including that field. This increases the serialization and deserialization time, the computational load during processing, and the network transmission volume. When dealing with a large number of data objects, this can lead to network congestion or even exceed the message body size set by the network transmission settings, severely impacting data transmission efficiency.
[0108] In the data method provided in this application embodiment, since new data structure protocols are introduced between different platforms, the data storage areas corresponding to each platform form protocol data by continuously storing data with the same data fields among different data objects (such as...). Figure 3The "protocol data" shown typically refers to data fields in character or string format. Whether storing, reading, or transmitting data, data corresponding to a specific data field can be processed directly. This eliminates the need for serialization and deserialization of data objects across platforms, reducing the time and computational overhead of serialization and deserialization. Furthermore, during network transmission, only the byte stream of the corresponding data field needs to be transmitted, rather than the byte stream of all data objects containing that data field, further reducing the bandwidth required for network transmission. This improves data transmission efficiency.
[0109] This application also provides a data transmission method. Figure 7 Another flowchart of the data transmission method provided in this application embodiment is shown. This data transmission method can be applied to data transmission between terminals, data transmission between a terminal and a server, and data transmission between servers. That is, in this data transmission method, the sender can be either a terminal or a server. Similarly, the receiver can be either a terminal or a server. In this application embodiment, both the sender and the receiver can be collectively referred to as a platform.
[0110] When a platform is used as a server, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0111] When a platform is used as the terminal, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and the server can be connected directly or indirectly through wired or wireless communication, and this application does not impose any restrictions. It is understood that when a platform is used as the terminal, the data transmission method can be executed directly on the terminal, or it can be executed by triggering a plugin or a button on the terminal, and based on the trigger operation, the server corresponding to the terminal can be called to implement the data transmission method.
[0112] like Figure 7 As shown, the method can be applied to the receiver, including steps S110 to S130.
[0113] Step S110: In response to the data acquisition request from the sender, determine the target data field corresponding to the data acquisition request.
[0114] Optionally, the data acquisition request may include an identifier for a target data field. A data field identifier is used to uniquely identify a data field. The specific form of the data field identifier is not limited in this embodiment and can be configured according to actual application requirements. Optionally, taking a target data field as an example, the identifier for the target data field may include, but is not limited to, the name of the target data field, a numeric identifier, a letter identifier, a combination of technical terms corresponding to the data field and numbers, or a combination of technical terms corresponding to a numeric field and letters. For example, the target data field may be field1.
[0115] After receiving a data retrieval request from the sender, the target data field corresponding to the target data field identifier in the data retrieval request can be obtained by parsing the data retrieval request.
[0116] Step S120: Obtain target data corresponding to the target data field from the pre-built data storage area. The data storage area pre-stores data stored according to a preset data structure protocol. The preset data structure protocol includes data storage according to at least one data field.
[0117] In this embodiment, the number of data fields is not limited, and the specific number of data fields can be determined according to actual needs. For example, the total number of data fields can be four, namely field1, field2, field3, and field4, that is, a data object can include four data fields. Of course, for a data object, the number of data fields it includes can be less than the total number of data fields. Taking the above example of a total of four data fields, a data object can include only data fields field1 and field4.
[0118] Since the preset data structure protocol includes data storage according to at least one data field, after obtaining the target data field, the data corresponding to the target data field can be found directly in the data storage area among the data corresponding to at least one data field. Specifically, if a certain data field in the data storage area is the target data field, then the data corresponding to that data field is determined to be the data corresponding to the target data field.
[0119] This application does not limit the form of the data storage area; it can be a local storage area or a cloud storage area. The method for obtaining the target data corresponding to the target data field from the pre-built data storage area can be as follows:
[0120] If the data storage area is a local storage area, it can be accessed directly to find the data corresponding to the target data field in the data corresponding to at least one data field.
[0121] If the data storage area is a cloud storage area, a request to retrieve the corresponding target data field can be sent through the corresponding cloud storage device (such as a cloud server) to trigger the cloud storage device to access the corresponding cloud storage space (data storage area) according to the request, and to find the data corresponding to the target data field in the data corresponding to at least one data field.
[0122] Step S130: Send the target data to the sender so that the sender can process the target data according to the target data fields.
[0123] In the data transmission method provided in this application embodiment, since the preset data structure protocol stores data according to at least one data field, the data pre-stored in the pre-built data storage area is stored according to the preset data structure protocol. In response to a data acquisition request from the sender, after determining the target data field corresponding to the data acquisition request, the target data corresponding to the target data field can be directly obtained from the pre-built data storage area and sent to the sender so that the sender can process the target data according to the target data field.
[0124] By directly transmitting the target data corresponding to the target data field, the receiver does not need to serialize the data object corresponding to the target data field. This eliminates the need for platforms (sender and receiver) to process other data within the data object containing the target data field besides the target data field, reducing the overhead of inter-platform serialization and deserialization. Furthermore, since the data transmitted over the network is the target data corresponding to the target data field, rather than the data object corresponding to the target data field, it also saves on network transmission overhead.
[0125] In this embodiment, the aforementioned preset data structure protocol can be configured for each platform during factory configuration. Alternatively, it can be configured during platform reconfiguration, such as during feature updates. Of course, if each platform is compatible with both the preset data structure protocol and its configured data structure protocol, the preset data structure protocol can be introduced at any time during data processing. Since introducing the preset data structure protocol reduces the overhead of inter-platform serialization and deserialization, it also saves network transmission overhead. Therefore, even if each platform is compatible with both the preset data structure protocol and its configured data structure protocol, it is preferable to use the preset data structure protocol for data storage.
[0126] Optionally, the data to be stored corresponds to at least two data objects, each data object including at least two data fields, and the method may further include:
[0127] Store at least two data objects belonging to the same data field into the same sub-region of the data storage area;
[0128] The process of retrieving target data corresponding to the target data field from a pre-built data storage area may include:
[0129] In the data storage area, identify the target sub-region corresponding to the target data field;
[0130] Retrieve target data from the target sub-region.
[0131] The data to be stored may include at least two data objects. The specific number of data objects can be determined by the actual amount of data to be stored, and this application does not impose any limitation on this. Figure 3 As shown, the data to be stored may include three data objects. Of course, the data to be stored may also include only one data object. Since in this embodiment, at least two data objects belonging to the same data field are stored in the same sub-region of the data storage area, the storage result corresponding to the data storage method provided in this embodiment is the same as the storage result corresponding to storing all fields of the same data object in the same sub-region of the data storage area according to the different data objects.
[0132] In this method, the sub-regions in the data storage area can be independent storage spaces or non-independent storage sub-spaces, and the embodiments of this application do not impose any restrictions on this.
[0133] When a sub-region within a data storage area is a non-independent storage subspace, the corresponding data for the target data field can be found by directly accessing that data storage area and locating the data corresponding to at least one data field. Therefore, the sub-region corresponding to the target data field within that data storage area is the aforementioned target sub-region.
[0134] When a sub-region within a data storage area is an independent storage subspace, at least two data objects belonging to the same data field can be stored within a single storage subspace, and a storage address is assigned to each storage subspace. The target data corresponding to the target data field is retrieved by accessing the storage address corresponding to the target data field. Therefore, the storage subspace corresponding to the target data field within that data storage area is the aforementioned target sub-region.
[0135] Taking a total of four data fields (field1, field2, field3, and field4) as an example, the data storage area can include four storage subspaces: the first storage subspace, the second storage subspace, the third storage subspace, and the fourth storage subspace. Within these four storage subspaces, the storage address of the first storage subspace is A1, and its corresponding storage content is the data corresponding to field1; its identifier can be B1. The storage address of the second storage subspace is A2, and its corresponding storage content is the data corresponding to field2; its identifier can be B2. The storage address of the third storage subspace is A3, and its corresponding storage content is the data corresponding to field3; its identifier can be B3. The storage address of the fourth storage subspace is A4, and its corresponding storage content is the data corresponding to field4; its identifier can be B4.
[0136] Optionally, after storing the data to be stored in the data storage area, a first list can be formed based on the correspondence between the storage addresses of each storage subspace and the identifiers of the corresponding storage subspaces. This first list is then stored in the data storage area. By accessing the data storage area, the first list can be retrieved, and the target data field can be searched within it. Furthermore, by accessing the storage address corresponding to the target data field, the target data corresponding to that field can be obtained. For example, if the total number of data fields is four, namely field1, field2, field3, and field4, the first list can be:
[0137] B1 Storage address A1 B2 Storage address A2 B3 Storage address A3 B4 Storage address A4
[0138] By storing at least two data objects belonging to the same data field into the same sub-region of the data storage area, continuous storage of data belonging to the same data field across different data objects can be achieved. During data retrieval, the target sub-region corresponding to the target data field can be directly identified, enabling rapid retrieval of the target data and thus accelerating the efficiency of the entire data transmission process.
[0139] Optionally, the method further includes: in response to a data acquisition request, determining a target network transmission mode corresponding to the data acquisition request;
[0140] Sending the target data to the sender also includes sending the target data to the sender via the target network transmission mode.
[0141] Since a data acquisition request is made after the two parties involved in data transmission have established data transmission, in order to improve data transmission efficiency, the system can directly respond to the data acquisition request, determine the target network transmission mode corresponding to the data acquisition request, and send the target data to the sender through the target data transmission mode.
[0142] Of course, other network transmission modes besides the target network transmission mode, which can be used by both parties transmitting data, can also be used to send the target data to the sender. This application does not impose any restrictions on this. For example, after obtaining the target data, if the data transmission frequency between the sender and receiver changes, or if there is a significant difference between the data volume of the target data and the data volume corresponding to the data acquisition request, a new network transmission mode can be determined based on the network attribute information of the network between the sender and receiver and the data volume of the target data. The network attribute information includes, but is not limited to, data transmission frequency, data transmission rate, and bandwidth, which this application does not restrict. The network transmission mode can be a protocol for data transmission between platforms. Optionally, the target network transmission mode includes any one of the following: REST network transmission mode, RPC network transmission mode, and socket network transmission mode.
[0143] This application embodiment uses network attribute information, including data transmission frequency, as an example to illustrate the specific method of determining the network transmission mode. For example, a new network transmission mode is determined based on the new data transmission frequency between the sender and receiver and the amount of target data. Specifically:
[0144] If the new data transmission frequency is less than the first preset threshold and the amount of target data is less than the second preset threshold, the new network transmission mode is determined to be the REST network transmission mode.
[0145] If the new data transmission frequency is greater than or equal to the first preset threshold and the amount of target data is less than the second preset threshold, the new network transmission mode is determined to be the RPC network transmission mode.
[0146] If the amount of target data is greater than or equal to the second preset threshold, the new network transmission mode is determined to be the socket network transmission mode.
[0147] This application does not impose any restrictions on the specific values of the first and second preset thresholds, which can be determined based on actual conditions (empirical or experimental values). For example, the first preset threshold can be set to 240 MHz and the second preset threshold to 52 kb (kilobyte).
[0148] Based on the above description, it can be determined that the REST network transmission mode can handle data transmission with small data volumes and low transmission frequency. The RPC network transmission mode can handle data transmission with small data volumes and high transmission frequency. The socket network transmission mode can handle data transmission with large data volumes. Of course, when the data volume is small, the socket network transmission mode can also be used for data transmission, and this application does not impose any restrictions on this. It should be noted that since sockets require more network maintenance than the former two, the former two can be implemented with only short connections, while sockets require long connections between the two parties transmitting data. Because the RPC network transmission mode can directly remotely call the program of another data transmission end, when the purpose of data transmission is relatively clear, such as directly obtaining the target data corresponding to the target data field as described in the embodiments of this application, the RPC network transmission mode can be preferred for data transmission.
[0149] By directly transmitting the target data according to the target network transmission mode corresponding to the data acquisition request, data transmission efficiency can be accelerated.
[0150] This application also provides another data transmission method. Figure 8 A flowchart of another data transmission method provided in an embodiment of this application is shown, such as... Figure 8 As shown, the method can be applied to the sender, including steps S210 to S230.
[0151] Step S210: In response to the data processing request, a data retrieval request is generated, which includes the target data field.
[0152] Data processing requests include, but are not limited to, data aggregation, encoding, and conversion of target data corresponding to target data fields, and this application does not impose any restrictions on such requests.
[0153] For the same data transmission methods required by the recipient as described above, please refer to the description of the corresponding methods for the sender shown above, which will not be repeated here.
[0154] Step S220: Send a data acquisition request to the receiver so that the receiver can acquire the target data corresponding to the target data field in the pre-built data storage area based on the target data field.
[0155] Step S230: Obtain the target data fed back by the receiver, and execute a data processing request on the target data based on the target data fields.
[0156] In the data transmission method provided in this application embodiment, since the preset data structure protocol stores data according to at least one data field, the data pre-stored in the pre-constructed data storage area is stored according to this preset data structure protocol. In response to a data processing request, a data retrieval request can be directly generated based on the target data field and sent to the receiver, enabling the receiver to retrieve the target data corresponding to the target data field from the pre-constructed data storage area. After receiving the target data from the receiver, the target data can be processed based on the target data field.
[0157] By generating a data retrieval request corresponding to the target data field, and based on the receiver's response to this request, directly executing a data processing request on the target data according to the target data field, the sender does not need to deserialize the data object corresponding to the target data field. This eliminates the need for platforms (sender and receiver) to process other data within the data object containing the target data field besides the target data field, reducing the overhead of inter-platform serialization and deserialization. Furthermore, since the data transmitted over the network is the target data corresponding to the target data field, rather than the data object corresponding to the target data field, it also saves on network transmission overhead and bandwidth.
[0158] Optionally, the method further includes: obtaining network attribute information of the network between the receiver and the sender, wherein the network attribute information includes data transmission frequency;
[0159] Determine the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request;
[0160] Sending the data retrieval request to the recipient as described above includes:
[0161] The data acquisition request is sent to the recipient through the target network transmission mode.
[0162] The network attribute information includes, but is not limited to, data transmission frequency, data transmission rate, and bandwidth, and this application does not impose any restrictions on these. This application uses data transmission frequency as an example of network attribute information to illustrate the specific method for determining the network transmission mode.
[0163] By directly using the network attribute information between the receiver and the sender, the corresponding target network transmission mode can be determined based on the data transmission frequency and the amount of data indicated in the data processing request. This can speed up data transmission efficiency and save unnecessary overhead during network transmission.
[0164] Optionally, the target network transmission mode includes any one of the following: REST network transmission mode, RPC network transmission mode, and socket network transmission mode;
[0165] The above determination of the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request includes:
[0166] If the data transmission frequency is less than the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be the REST network transmission mode.
[0167] If the data transmission frequency is greater than or equal to the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be the RPC network transmission mode.
[0168] If the data volume is greater than or equal to the second preset threshold, the target network transmission mode is determined to be the socket network transmission mode.
[0169] By accurately determining the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request, data transmission efficiency can be accelerated and unnecessary overhead during network transmission can be saved.
[0170] To facilitate understanding of the application value of the data transmission method provided in this application, a specific application scenario embodiment is described below. The solution provided in this application can be applied to video recommendation processes. This solution can be implemented as an application or an application plugin. Through this application, users can enter search keywords on the search page of their terminal device to obtain videos related to the search keywords. The server can then filter videos related to the search keywords that do not exist in the target area and recommend them to the user.
[0171] The video processing method provided in this application can be applied to any scenario that requires video processing, including but not limited to video recommendation scenarios. To better illustrate the practicality of the solutions in this application, the solutions in this application are described below in conjunction with a video recommendation scenario.
[0172] Figure 9 An architecture diagram of the data transmission system provided in an embodiment of this application is shown. Figure 10 A data storage architecture diagram of the data transmission system provided in an embodiment of this application is shown. Figure 9 As shown, this data transmission system includes server 10, network transport layer (network) 20, and another server 30. The platforms located on either side of the network transport layer are servers, which can act as senders and receivers to each other, transmitting data via RPC network transmission mode. Figure 9As shown, this data storage area ( Figure 9 Storage methods and Figure 3 The "in-memory structure" and "protocol data" are stored in the same way. 25 data objects are stored, each including the corresponding date and the temperature at the top of each hour within the 24 hours corresponding to that date. The following explanation uses server 10 as the sender and server 30 as the receiver, with server 10 needing to obtain the temperature at 12:00, and server 30 storing data from its local application b (i.e., in the server's memory).
[0173] Step S21: Application a on server 10 initiates a remote method call to server 30, wherein the method call includes the target data field "temperature at 12 o'clock".
[0174] Step S22: After receiving the method call, server 30 can directly access the memory of application b on server 30 to perform a local call and obtain the target data corresponding to "temperature at 12 o'clock" from the memory of application b, that is... Figure 10 The data corresponding to data field 13 in the middle.
[0175] Step S23: Server 30, according to the RPC network transmission mode, sends the target data corresponding to "temperature at 12 o'clock" in memory to server 10 through binary (bytes) stream data and through the RPC network transmission protocol.
[0176] Step S24: Server 10 receives the bytes stream data. The bytes stream data is converted into the target data corresponding to the target data field and then saved.
[0177] This application provides a data transmission device. Figure 11 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application, as shown below. Figure 11 As shown, the data transmission device 60 may include: a target data field determination module 601, a target data acquisition module 602, and a transmission module 603, wherein,
[0178] The target data field determination module 601 is used to determine the target data field corresponding to the data acquisition request in response to the data acquisition request from the sender;
[0179] The target data acquisition module 602 is used to acquire target data corresponding to the target data field from a pre-built data storage area. The data storage area pre-stores data stored according to a preset data structure protocol. The preset data structure protocol includes data storage according to at least one data field.
[0180] The sending module 603 is used to send the target data to the sender so that the sender can process the target data according to the target data fields.
[0181] Optionally, the data to be stored corresponds to at least two data objects, each data object including at least two data fields, and the device further includes a storage module.
[0182] A storage module is used to store at least two data objects belonging to the same data field into the same sub-area of the data storage area;
[0183] Specifically, when the target data acquisition module 602 acquires target data corresponding to the target data field from the pre-built data storage area, it is used for:
[0184] In the data storage area, identify the target sub-region corresponding to the target data field;
[0185] Retrieve target data from the target sub-region.
[0186] Optionally, the device further includes a target network transmission mode determination module.
[0187] The target network transmission mode determination module is used to determine the target network transmission mode corresponding to the data acquisition request in response to the data acquisition request.
[0188] Specifically, when sending target data to the sender, the sending module 603 is used for:
[0189] The target data is sent to the sender via the target network transmission mode.
[0190] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0191] This application provides a data transmission device. Figure 12 This is a schematic diagram of another data transmission device provided in an embodiment of this application, as shown below. Figure 12 As shown, the data transmission device 70 may include: a data acquisition request generation module 701, a data acquisition request sending module 702, and a target data acquisition module 703, wherein,
[0192] The data acquisition request generation module 701 is used to generate a data acquisition request in response to a data processing request. The data acquisition request includes a target data field.
[0193] The data acquisition request sending module 702 is used to send a data acquisition request to the receiver so that the receiver can acquire the target data corresponding to the target data field in the pre-built data storage area based on the target data field;
[0194] The target data acquisition module 703 is used to acquire the target data fed back by the receiver and to perform data processing requests on the target data based on the target data fields.
[0195] Optionally, the device further includes an acquisition module and a target network transmission mode determination module.
[0196] The acquisition module is used to acquire network attribute information of the network between the receiver and the sender, including data transmission frequency.
[0197] The target network transmission mode determination module is used to determine the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request.
[0198] When sending a data acquisition request to the receiver, the data acquisition request sending module 702 is specifically used for:
[0199] The data acquisition request is sent to the recipient through the target network transmission mode.
[0200] Optionally, the target network transmission mode includes any one of the following: REST network transmission mode, RPC network transmission mode, and socket network transmission mode;
[0201] When determining the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request, the target network transmission mode determination module is specifically used for:
[0202] If the data transmission frequency is less than the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be the REST network transmission mode.
[0203] If the data transmission frequency is greater than or equal to the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be the RPC network transmission mode.
[0204] If the data volume is greater than or equal to the second preset threshold, the target network transmission mode is determined to be the socket network transmission mode.
[0205] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0206] Based on the same principle as the data transmission method and apparatus provided in the embodiments of this application, the embodiments of this application also provide an electronic device (such as a server), which may include a memory, a processor and a computer program stored in the memory, the processor executing the computer program to implement the steps of the method provided in any optional embodiment of this application.
[0207] Optionally, Figure 13 A schematic diagram of the structure of an electronic device to which this application embodiment applies is shown, such as... Figure 13 As shown, Figure 13 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this application.
[0208] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0209] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 13 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0210] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0211] The memory 4003 stores computer programs that execute embodiments of this application, and its execution is controlled by the processor 4001. The processor 4001 executes the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
[0212] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments.
[0213] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0214] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.
[0215] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0216] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. A data transmission method, characterized in that, Applied to the recipient, in the video recommendation process, the method includes: In response to a data acquisition request from a sender, a target data field corresponding to the data acquisition request is determined; the receiver is a server or a terminal; the sender is a server or a terminal. Target data corresponding to the target data field is directly obtained from a pre-constructed data area, wherein the data area is pre-stored with data stored according to a preset data structure protocol, and the preset data structure protocol includes continuous data storage according to at least one data field; Based on the network attribute information of the network between the receiver and the sender and the amount of data indicated in the data acquisition request, a target network transmission mode corresponding to the data acquisition request is determined; the network attribute information includes the data transmission frequency. The target data is directly sent to the sender through the target network transmission mode, so that the sender can directly process the target data based on the target data field. The method further includes: The data to be stored corresponds to at least two data objects, each data object includes at least two data fields; The data to be stored corresponds to at least two data objects; Each data object includes at least two data fields; The method further includes: Data to be stored for at least two data objects belonging to the same data field are stored consecutively in the same sub-region of the data region; The step of directly obtaining the target data corresponding to the target data field from the pre-constructed data area includes: Determine the target sub-region corresponding to the target data field within the data region; The target sub-region is an independent storage space, from which the target data is directly obtained; or, the target sub-region is a non-independent storage space, where all data corresponding storage areas are accessed, and it is sequentially determined whether the currently accessed data is the target data. If so, the currently accessed data is used as the target data, until the accessed data is not the target data. Both the receiver and the sender are configured with the preset data structure protocol through factory configuration or function update reconfiguration; the receiver supports compatibility between the preset data structure protocol and the configured data structure protocol, and uses the preset data structure protocol for data storage; the sender supports compatibility between the preset data structure protocol and the configured data structure protocol, and uses the preset data structure protocol for data storage.
2. A data transmission method, characterized in that, Applied to the sender, in the video recommendation process, the method includes: In response to a data processing request, a data acquisition request is generated, the data acquisition request including a target data field; Based on the network attribute information of the network between the receiver and the sender and the amount of data indicated in the data processing request, a target network transmission mode corresponding to the data acquisition request is determined; the network attribute information includes the data transmission frequency; the receiver is a server or a terminal; the sender is a server or a terminal. The data acquisition request is sent to the receiver via the target network transmission mode, enabling the receiver to determine the target sub-region corresponding to the target data field in a pre-constructed data region based on the target data field, and directly acquire the target data from the target sub-region; wherein, the target sub-region is an independent storage space, and the receiver directly acquires the target data from the target sub-region; or, the target sub-region is a non-independent storage space, and the receiver accesses all storage regions corresponding to the data, sequentially determining whether the currently accessed data is the target data, and if so, using the currently accessed data as the target data, until the accessed data is not the target data; Obtain the target data fed back by the receiver, and directly execute the data processing request on the target data based on the target data fields; The data area contains data stored according to a preset data structure protocol, which includes continuous data storage according to at least one data field. In this context, the data area is formed by continuously storing the data to be stored in the same sub-area of at least two data objects belonging to the same data field; the data to be stored corresponds to at least two data objects, and each data object includes at least two data fields. Both the receiver and the sender are configured with a preset data structure protocol through factory configuration or function update reconfiguration. The receiver supports compatibility between the preset data structure protocol and the configured data structure protocol, and uses the preset data structure protocol for data storage. The sender supports compatibility between the preset data structure protocol and the configured data structure protocol, and uses the preset data structure protocol for data storage.
3. The method according to claim 2, characterized in that, The target network transmission mode includes any one of the following: REST network transmission mode, RPC network transmission mode, and socket network transmission mode; Determining the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request includes: If the data transmission frequency is less than a first preset threshold and the data volume is less than a second preset threshold, the target network transmission mode is determined to be a REST network transmission mode. If the data transmission frequency is greater than or equal to the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be an RPC network transmission mode. If the amount of data is greater than or equal to the second preset threshold, the target network transmission mode is determined to be the socket network transmission mode.
4. A data transmission device, characterized in that, Applied to the recipient during the video recommendation process, the device includes: A target data field determination module is used to determine a target data field corresponding to a data acquisition request from a sender; the receiver is a server or a terminal; the sender is a server or a terminal. The target data acquisition module is used to directly acquire target data corresponding to the target data field from a pre-constructed data area. The data area pre-stores data stored according to a preset data structure protocol, which includes continuous data storage according to at least one data field. The target network transmission mode determination module is used to determine the target network transmission mode corresponding to the data acquisition request based on the network attribute information of the network between the receiver and the sender and the amount of data indicated in the data acquisition request; the network attribute information includes the data transmission frequency; The sending module is used to directly send the target data to the sender through the target network transmission mode, so that the sender can directly process the target data according to the target data field; The data to be stored corresponds to at least two data objects, each data object includes at least two data fields, and the device further includes a storage module. The storage module is used to continuously store the data to be stored of at least two data objects belonging to the same data field into the same sub-region of the data region; Specifically, when the target data acquisition module directly acquires the target data corresponding to the target data field from the pre-constructed data area, it is used for: Determine the target sub-region corresponding to the target data field within the data region; The target sub-region is an independent storage space, from which the target data is directly obtained; or, the target sub-region is a non-independent storage space, where all data corresponding storage areas are accessed, and it is sequentially determined whether the currently accessed data is the target data. If so, the currently accessed data is used as the target data, until the accessed data is not the target data. Both the receiver and the sender are configured with the preset data structure protocol through factory configuration or function update reconfiguration; the receiver supports compatibility between the preset data structure protocol and the configured data structure protocol, and uses the preset data structure protocol for data storage; the sender supports compatibility between the preset data structure protocol and the configured data structure protocol, and uses the preset data structure protocol for data storage.
5. A data transmission device, characterized in that, Applied to the sender, in the video recommendation process, the device includes: A data acquisition request generation module is used to generate a data acquisition request in response to a data processing request, wherein the data acquisition request includes a target data field; The acquisition module is used to acquire network attribute information of the network between the receiver and the sender, the network attribute information including data transmission frequency; the receiver is a server or a terminal; the sender is a server or a terminal; The target network transmission mode determination module is used to determine the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request. A data acquisition request sending module is used to send the data acquisition request to the receiver through the target network transmission mode, so that the receiver can determine the target sub-region corresponding to the target data field in a pre-constructed data region based on the target data field, and directly acquire the target data from the target sub-region; wherein, the target sub-region is an independent storage space, and the receiver directly acquires the target data from the target sub-region; or, the target sub-region is a non-independent storage space, and the receiver accesses all storage regions corresponding to the data, sequentially determining whether the currently accessed data is the target data, and if so, using the currently accessed data as the target data, until the accessed data is not the target data; The target data acquisition module is used to acquire the target data fed back by the receiver, and directly execute the data processing request on the target data based on the target data fields; The data area contains data stored according to a preset data structure protocol, which includes continuous data storage according to at least one data field. In this context, the data area is formed by continuously storing the data to be stored in the same sub-area of at least two data objects belonging to the same data field; the data to be stored corresponds to at least two data objects, and each data object includes at least two data fields. Both the receiver and the sender are configured with a preset data structure protocol through factory configuration or function update reconfiguration. The receiver supports compatibility between the preset data structure protocol and the configured data structure protocol, and uses the preset data structure protocol for data storage. The sender supports compatibility between the preset data structure protocol and the configured data structure protocol, and uses the preset data structure protocol for data storage.
6. The apparatus according to claim 5, characterized in that, The target network transmission mode includes any one of the following: REST network transmission mode, RPC network transmission mode, and socket network transmission mode; When determining the target network transmission mode based on the data transmission frequency and the amount of data indicated in the data processing request, the target network transmission mode determination module is used for: If the data transmission frequency is less than a first preset threshold and the data volume is less than a second preset threshold, the target network transmission mode is determined to be a REST network transmission mode. If the data transmission frequency is greater than or equal to the first preset threshold and the data volume is less than the second preset threshold, the target network transmission mode is determined to be an RPC network transmission mode. If the amount of data is greater than or equal to the second preset threshold, the target network transmission mode is determined to be the socket network transmission mode.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method of claim 1, or the steps of the method of claim 2 or 3.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method of claim 1, or the steps of the method of claim 2 or 3.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method of claim 1, or the steps of the method of claim 2 or 3.
Citation Information
Patent Citations
Data search method and device and electronic equipment
CN112328636A
Data storage control method and device, computing equipment and medium
CN112925792A
Data processing method and device applied to core system, medium and electronic equipment
CN113886479A