Disclosure of Invention
In view of the above, the present application provides a data transmission method, apparatus, electronic device and readable storage medium to improve the above problem.
The embodiment of the application can be realized as follows:
in a first aspect, the present application provides a data transmission method, which is applied to a data transmission system, where the system is configured with at least one bidding rule, and each bidding rule includes a unique identifier and a bidding indicator corresponding to at least one data type; the method comprises the following steps:
acquiring at least one piece of data to be processed, wherein each piece of data to be processed comprises a unique identifier and a data type identifier;
for each piece of data to be processed, obtaining a target bidding rule which is consistent with the unique identifier included in the data to be processed from each bidding rule, and obtaining a bidding index which corresponds to the data type identifier included in the data to be processed in the target bidding rule;
for each piece of data to be processed, generating data to be transmitted based on a bidding index corresponding to a data type identifier included in the data to be processed and the data to be processed;
and prioritizing each data to be transmitted according to the size of each bidding index, and transmitting each data to be transmitted based on the priority.
In an optional embodiment, the step of generating the data to be transmitted based on the data type identifier included in the data to be processed and the data to be processed for each piece of the data to be processed includes:
acquiring a current network congestion coefficient, wherein the network congestion coefficient is used for representing the network congestion degree;
calculating to obtain a target bidding index corresponding to the data to be processed based on the network congestion coefficient and the bidding index corresponding to the data type identifier included in each data to be processed;
performing encryption processing or digital signature processing on a target bidding index included in each piece of data to be processed to obtain encrypted data or digital signature data corresponding to the data to be processed;
generating data to be transmitted according to each piece of data to be processed and encrypted data corresponding to the data to be processed; or generating the data to be transmitted according to each piece of the data to be processed and the digital signature data corresponding to the data to be processed. In an optional embodiment, the step of obtaining the current network congestion coefficient includes:
acquiring network bandwidth data and current load bandwidth data;
and calculating a quotient value of the current load bandwidth data and the network bandwidth data, and taking the quotient value as a network congestion coefficient.
In an optional embodiment, a public key is stored in the system in advance, and the step of performing encryption processing or digital signature processing on the target bid indicator included in each piece of the to-be-processed data to obtain encrypted data or digital signature data corresponding to the to-be-processed data includes:
encrypting the target bidding indexes included in each piece of data to be processed based on the public key to obtain encrypted data corresponding to the data to be processed; or,
and performing digital signature on the target bidding indexes included in each piece of data to be processed based on the unique identifier to obtain digital signature data corresponding to the data to be processed.
In an alternative embodiment, the method further comprises:
receiving bidding rule data;
configuring based on the bidding rule data to obtain a bidding rule; or updating based on the bidding rule data to obtain an updated bidding rule.
In an alternative embodiment, the method further comprises:
obtaining a bidding index and a charging index included in the data to be transmitted;
and calculating data transmission income based on the bidding index and the charging index.
In a second aspect, the present application provides a data transmission apparatus, which is applied to a data transmission system, where the system is configured with at least one bidding rule, and each bidding rule includes a unique identifier and a bidding index corresponding to at least one data type; the device comprises:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring at least one piece of data to be processed, and each piece of data to be processed comprises a unique identifier and a data type identifier;
the obtaining module is further configured to obtain, for each piece of to-be-processed data, a target bidding rule that is consistent with a unique identifier included in the piece of to-be-processed data from each bidding rule, and obtain a bidding index corresponding to a data type identifier included in the piece of to-be-processed data in the target bidding rule;
the generating module is used for generating data to be transmitted according to the bidding indexes corresponding to the data type identifications included in the data to be processed and the data to be processed aiming at each data to be processed;
and the dividing module is used for dividing the priority of each data to be transmitted according to the size of each bidding index and transmitting each data to be transmitted based on the priority.
In an optional embodiment, the generating module is further configured to:
encrypting each piece of data to be processed to obtain encrypted data corresponding to the data to be processed;
acquiring a current network congestion coefficient, wherein the network congestion coefficient is used for representing the network congestion degree;
calculating to obtain a target bidding index corresponding to the data to be processed based on the network congestion coefficient and the bidding index corresponding to the data type identifier included in each data to be processed;
and generating data to be transmitted according to the target bidding index of each data to be processed and the encrypted data.
In a third aspect, the present application provides an electronic device, including a processor, a memory and a bus, where the memory stores machine-readable instructions executable by the processor, and when the electronic device runs, the processor and the memory communicate with each other through the bus, and the processor executes the machine-readable instructions to perform the steps of the data transmission method according to any one of the foregoing embodiments.
In a fourth aspect, the present application provides a readable storage medium storing a computer program, which when executed, implements the steps of the data transmission method according to any one of the preceding embodiments.
The embodiment of the application provides a data transmission method, a data transmission device, electronic equipment and a readable storage medium. And aiming at each data to be processed, obtaining a target bidding rule which is consistent with the unique identifier included in the data to be processed from all pre-configured bidding rules, and obtaining a bidding index which corresponds to the data type identifier included in the data to be processed in the target bidding rule. And then, for each piece of data to be processed, generating data to be transmitted based on a bidding index corresponding to the data type identifier included in the data to be processed and the data to be processed. And finally, the priority is divided for each data to be transmitted according to the size of each bidding index, and each data to be transmitted is transmitted based on the priority, so that the problem that the data of part of users cannot be processed in time under the condition that a plurality of users share link resources is solved.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, several embodiments accompanied with figures are described in detail below.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Furthermore, the appearances of the terms "first," "second," and the like, if any, are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
It should be noted that the features of the embodiments of the present application may be combined with each other without conflict.
As introduced by the background, limited link resources are typically shared by multiple tenants during network transmission. When data needs to be transmitted, the data is usually statically classified according to the user level and the importance of the data, and the link performs QoS (Quality of Service) according to the classification. This scheme is less flexible, but the limited resources are unevenly distributed, often resulting in data of low-level users not being processed in a timely manner.
How to solve the problem that the data of part of users cannot be processed in time under the condition that a plurality of users share link resources is a problem which needs to be solved urgently at present.
In view of this, embodiments of the present application provide a data transmission method, an apparatus, an electronic device, and a readable storage medium, which determine bidding indexes of different data according to a bidding rule configured in advance. The data is processed and transmitted according to the size of the bidding index to improve the problem. The above scheme is explained in detail below.
Referring to fig. 1, fig. 1 is a block diagram of an electronic device 100 according to an embodiment of the present disclosure. The device may include a processor 120, a memory 110, a data transmission apparatus 130, and a communication unit 140, where the memory 110 stores machine-readable instructions executable by the processor 120, when the electronic device 100 operates, the processor 120 and the memory 110 communicate with each other through a bus, and the processor 120 executes the machine-readable instructions and performs the steps of the data transmission method.
The elements of the memory 110, the processor 120 and the communication unit 140 are electrically connected to each other directly or indirectly to realize the transmission or interaction of signals.
For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The data transmission device 130 includes at least one software functional module that can be stored in the memory 110 in the form of software or firmware (firmware). The processor 120 is used to execute executable modules stored in the memory 110, such as software functional modules or computer programs included in the data transmission device 130.
The Memory 110 may be, but is not limited to, a Random ACCess Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 120 may be an integrated circuit chip having signal processing capabilities. The Processor 120 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and so on.
But may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In the embodiment of the present application, the memory 110 is used for storing a program, and the processor 120 is used for executing the program after receiving the execution instruction. The method defined by the process disclosed in any of the embodiments of the present application can be applied to the processor 120, or implemented by the processor 120.
The communication unit 140 is used to establish a communication connection between the electronic apparatus 100 and another electronic apparatus via a network, and to transmit and receive data via the network.
In some embodiments, the network may be any type of wired or wireless network, or combination thereof. Merely by way of example, the Network may include a wired Network, a Wireless Network, a fiber optic Network, a telecommunications Network, an intranet, the internet, a Local Area Network (LAN), a Wide Area Network (WAN), a Wireless Local Area Network (WLAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a Public Switched Telephone Network (PSTN), a bluetooth Network, a ZigBee Network, a Near Field Communication (NFC) Network, or the like, or any combination thereof.
In the embodiment of the present application, the specific type of the electronic device 100 is not limited, and for example, the electronic device may be, but is not limited to, a smart phone, a Personal Computer (PC), a tablet PC, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), a web server, a data server, a gateway device, and other devices having a processing function.
It will be appreciated that the configuration shown in figure 1 is merely illustrative. Electronic device 100 may also have more or fewer components than shown in FIG. 1, or a different configuration than shown in FIG. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
Based on the implementation architecture of the electronic device 100, an embodiment of the present application provides a data transmission method, please refer to fig. 2 in combination, and fig. 2 is one of flowcharts of the data transmission method provided in the embodiment of the present application. The following is described in detail with reference to the specific flow shown in fig. 2.
Referring to fig. 2, fig. 2 is a flowchart of a data transmission method according to an embodiment of the present application. The embodiment of the application provides a data transmission method, which is applied to a data transmission system, the system is configured with at least one bidding rule, each bidding rule comprises a unique identifier and a bidding index corresponding to at least one data type, and the method comprises the following steps:
step S1, at least one to-be-processed data is obtained, where each to-be-processed data includes a unique identifier and a data type identifier.
Step S2, for each piece of data to be processed, obtaining a target bidding rule that is consistent with the unique identifier included in the piece of data to be processed from each bidding rule, and obtaining a bidding indicator corresponding to the data type identifier included in the piece of data to be processed in the target bidding rule.
Step S3, for each piece of to-be-processed data, generating to-be-transmitted data based on the data type identifier included in the to-be-processed data and the corresponding bid indicator.
And step S4, prioritizing each data to be transmitted according to the size of each bidding index, and transmitting each data to be transmitted based on the priority.
Wherein the data type identification is used to mark different types of data. For example, the types of data may include critical data, general index data, and health check data. It may be tagged with a data type identification for different data types.
Further, the data can be collected by different sensors and uploaded. For industrial purposes, for example, critical data may include operating parameters of the work device, such as temperature, pressure, and throughput. The health check data may include a current value, a voltage value, a rotational speed of the working device, and the like. The general index data includes area information where the working device is located, position information, weather information of the area where the working device is located, temperature information of the area where the working device is located, humidity information of the area where the working device is located, and the like.
For example, the data type represented by the data type identifier a may be key data, the data type represented by the data type identifier B may be health check data, the data type represented by the data type identifier C may be general index data, and the data type represented by the data type identifier D may be other data.
The bid indicator may characterize the importance of different data. For example, as shown in table 1, different users generate bidding rules based on their own needs and deploy the rules to the data transmission system. For example, the user a uploads a bidding rule with unique identification information of 123, the bidding index of the key data with data type identification of a is 2, the bidding index of the health check data with data type identification of B is 3, and the bidding index of the general index data with data type identification of C is 1. It can be seen that the health check data of data type B is of the highest importance to the user.
Similarly, the unique identification information uploaded by the user B is a bidding rule of 124, the bidding index of the key data with the data type identification a is 5, the bidding index of the health check data with the data type identification B is 2, and the bidding index of the general index data with the data type identification C is 2. It can be seen that the key data of data type identified as a is of highest importance to the user.
Similarly, the unique identification information uploaded by the user C is a bidding rule of 125, the bidding index of the key data with the data type identification a is 1, the bidding index of the health check data with the data type identification B is 3, and the bidding index of the general index data with the data type identification D is 1. It can be seen that the health check data of data type a is of the highest importance to the user.
TABLE 1
For example, if the obtained data to be transmitted includes first data to be transmitted, second data to be transmitted, and third data to be transmitted, unique identification information and data type identification included in each data are respectively as shown in table 2 below:
TABLE 2
Data to be transmitted
|
Unique identification
|
Data type identification
|
First data to be transmitted
|
123
|
B
|
Second to-be-transmitted data
|
124
|
A
|
Third to-be-transmitted data
|
124
|
C |
For each data to be transmitted, as can be seen from table 1 and table 2, the bidding index of the first data to be transmitted is 3, the bidding index of the second data to be transmitted is 5, and the bidding index of the third data to be transmitted is 2.
Thus, the highest priority of the second data to be transmitted, the second priority of the first data to be transmitted and the lowest priority of the third data to be transmitted can be determined according to the size of each bidding index. Finally, each data to be transmitted can be transmitted based on the priority. The problem that data of part of users cannot be processed in time under the condition that a plurality of users share link resources is solved.
As another embodiment, on the basis of the above, a party such as a network operator who provides a data transmission service may further obtain a bidding index included in the data to be transmitted, and a charging index. And calculating the data transmission profit based on the bidding index and the charging index.
For example, the billing index may be 0, 0.1, 0.2, … …, 1 …, and so on. Taking the charging index as 1 as an example, if the bidding index of the data to be transmitted is 5, the data transmission profit is 5 × 1= 5.
For another example, if the charging index is 0.5 and the bidding index of the data to be transmitted is 2, the data transmission profit of the data to be transmitted is 2 × 0.5= 1.
The data transmission profit is provided by the user and received by the party providing the data transmission service, thereby determining different data transmission profits according to the bidding indexes of different data.
Further, as an optional implementation manner, step S3 may be implemented by the following manner to generate the data to be transmitted:
and acquiring a current network congestion coefficient, wherein the network congestion coefficient is used for representing the network congestion degree. And calculating to obtain a target bidding index corresponding to the data to be processed based on the network congestion coefficient and the bidding index corresponding to the data type identifier included in each data to be processed. And performing encryption processing or digital signature processing on the target bidding index included in each piece of data to be processed to obtain encrypted data or digital signature data corresponding to the data to be processed. And generating data to be transmitted according to each piece of the data to be processed and the encrypted data corresponding to the data to be processed. Or generating the data to be transmitted according to each piece of the data to be processed and the digital signature data corresponding to the data to be processed.
The encryption process may be a symmetric encryption method or an asymmetric encryption method. The data to be processed can not be illegally tampered, information of a user is leaked, or bidding indexes are modified, and loss is caused to the user.
Illustratively, if the network congestion coefficient is 0.8 and the bid index corresponding to the data type identifier included in the to-be-processed data is 3, it is calculated that the target bid index corresponding to the to-be-processed data is 3 × 0.8= 2.4. And finally, generating the data to be transmitted according to the target bidding index of the data to be processed and the encrypted data.
As an optional implementation manner, a public key and a private key are stored in the system in advance, and the encryption processing or the digital signature processing may be performed on the target bid indicator included in each piece of data to be processed in the following manner:
and encrypting the target bidding indexes included in each piece of data to be processed based on the public key to obtain encrypted data corresponding to the data to be processed.
Or based on the unique identifier, performing digital signature on the target bidding index included in each piece of data to be processed to obtain digital signature data corresponding to the piece of data to be processed.
The digital signature can process the data to be processed through a Hash function to obtain an abstract of the data to be processed, and then the abstract is encrypted by using a private key to complete the digital signature.
Therefore, the receiver can decrypt the encrypted data by using the public key to obtain the abstract, then processes the encrypted data by using the same Hash function to obtain a decryption result, compares the decryption result with the abstract, and if the decryption result is consistent with the abstract, proves that the encrypted data is not modified and is valid data. On the contrary, the encrypted data can be determined to be invalid data after being modified by other people, so that the encrypted data cannot be tampered and repudiated after the bidding signature or encryption, and can be used for a money collection certificate, and the data to be processed cannot be illegally tampered, so that information of a user is leaked, or a bidding index is modified, and loss is caused to the user.
As an optional implementation manner, the step of obtaining the current network congestion coefficient includes:
and acquiring network bandwidth data and current load bandwidth data.
And calculating a quotient value of the current load bandwidth data and the network bandwidth data, and taking the quotient value as a network congestion coefficient.
For example, if the network bandwidth data is 100G and the current load bandwidth data is 80G, the quotient of the current load bandwidth data and the network bandwidth data is 80/100=0.8, and the network congestion coefficient is 0.8.
For another example, if the network bandwidth data is 100G and the current load bandwidth data is 100G, the quotient of the current load bandwidth data and the network bandwidth data is 100/100=1, and the network congestion coefficient is 1.
In order to facilitate the user to adjust the bidding rule in real time according to the requirement, the embodiment of the application can also adjust the bidding rule in real time through an updating or configuration mode.
As an alternative embodiment, bidding rule data is received. And configuring based on the bidding rule data to obtain a bidding rule.
As another alternative embodiment, bidding rule data is received. And updating based on the bidding rule data to obtain an updated bidding rule.
For example, if the user's paid upload quota is sufficient for a certain period of time, the bidding rule data can be re-customized, and the bidding indicator of the less important data is adjusted up to allow the data to be sent to the destination quickly.
For another example, if the payment uploading amount of the user is insufficient for a certain period of time, the bidding rule data can be customized again, the bidding index of the secondary important data is adjusted downward, and the secondary important data is transmitted on the premise of ensuring the uploading of the important data.
For another example, if the current load bandwidth data is less and there is no data congestion, the bidding indicators of all types of data can be adjusted downward to reduce the cost.
Referring to fig. 3, fig. 3 is a schematic diagram of a data transmission system according to an embodiment of the present disclosure. The embodiment of the application also provides a data transmission system, which comprises a data acquisition layer, a data pricing layer, a data caching layer and a shared link layer.
The data acquisition layer can comprise various sensors and other devices and is used for acquiring data to be transmitted. The types of the data to be transmitted can include critical data, general index data, health examination data and the like. It may be tagged with a data type identification for different data types. For industrial purposes, for example, critical data may include operating parameters of the work device, such as temperature, pressure, and throughput. The health check data may include a current value, a voltage value, a rotational speed of the working device, and the like. The general index data includes area information where the working device is located, position information, weather information of the area where the working device is located, temperature information of the area where the working device is located, humidity information of the area where the working device is located, and the like.
The data pricing layer can comprise an industrial gateway, a user can generate bidding rules according to own requirements and configure the bidding rules in the industrial gateway, so that the industrial gateway encrypts data to be transmitted based on the bidding rules, configures priority for each data to be transmitted according to bidding indexes and forwards the data to the data caching layer.
The data caching layer may include a network operator that caches all data to be transmitted and sends the data to be transmitted to a destination through the shared link layer based on a priority of each data to be transmitted.
In this way, the priorities of different data to be transmitted can be determined according to the sizes of the bidding indexes, and the data to be transmitted can be transmitted based on the priorities. The problem that data of part of users cannot be processed in time under the condition that a plurality of users share link resources is solved.
Based on the same inventive concept, please refer to fig. 4 in combination, and fig. 4 is a functional block diagram of a data transmission device according to an embodiment of the present application. The embodiment of the application also provides a data transmission device corresponding to the data transmission method, and the device comprises:
the obtaining module 131 is configured to obtain model data to be rendered of a model to be rendered, where the model to be rendered is applied to a data transmission system, the system is configured with at least one bidding rule, and each bidding rule includes a unique identifier and a bidding index corresponding to at least one data type; the device comprises:
the obtaining module 131 is configured to obtain at least one piece of data to be processed, where each piece of data to be processed includes a unique identifier and a data type identifier.
The obtaining module 131 is further configured to, for each piece of data to be processed, obtain, from each bidding rule, a target bidding rule that is consistent with the unique identifier included in the piece of data to be processed, and obtain a bidding index corresponding to the data type identifier included in the piece of data to be processed in the target bidding rule.
The generating module 132 is configured to, for each piece of to-be-processed data, generate to-be-transmitted data based on the data type identifier included in the to-be-processed data and the bid indicator corresponding to the to-be-processed data.
The dividing module 133 is configured to prioritize each to-be-transmitted data according to the size of each bidding indicator, and transmit each to-be-transmitted data based on the priority.
As an optional implementation, the generating module 132 is further configured to:
and encrypting each piece of data to be processed to obtain encrypted data corresponding to the data to be processed.
And acquiring a current network congestion coefficient, wherein the network congestion coefficient is used for representing the network congestion degree.
And calculating to obtain a target bidding index corresponding to the data to be processed based on the network congestion coefficient and the bidding index corresponding to the data type identifier included in each data to be processed.
And generating the data to be transmitted according to the target bidding index of each data to be processed and the encrypted data.
Because the principle of the apparatus in the embodiment of the present application for solving the problem is similar to that of the above-mentioned report data transmission method in the embodiment of the present application, the implementation principle of the apparatus can refer to the implementation principle of the method, and repeated details are not repeated.
The embodiment of the present application also provides a readable storage medium, in which a computer program is stored, and when the computer program is executed, the data transmission method is implemented.
In summary, the present application provides a data transmission method, an apparatus, an electronic device 100, and a readable storage medium, which are applied to a data transmission system, where the system is configured with at least one bidding rule, and each bidding rule includes a unique identifier and a bidding indicator corresponding to at least one data type. The method comprises the steps of obtaining at least one piece of data to be processed, wherein each piece of data to be processed comprises a unique identifier and a data type identifier. And aiming at each data to be processed, obtaining a target bidding rule which is consistent with the unique identifier included in the data to be processed from each bidding rule, and obtaining a bidding index which corresponds to the data type identifier included in the data to be processed in the target bidding rule. And then, for each piece of data to be processed, generating data to be transmitted based on a bidding index corresponding to the data type identifier included in the data to be processed and the data to be processed. And finally, the priority is divided for each data to be transmitted according to the size of each bidding index, and each data to be transmitted is transmitted based on the priority, so that the problem that the data of part of users cannot be processed in time under the condition that a plurality of users share link resources is solved.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.