Detailed Description
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of illustrating the present disclosure and should not be construed as limiting the same. Rather, the embodiments of the disclosure include all changes, modifications and equivalents coming within the spirit and terms of the claims appended thereto.
It should be noted that the execution main body of the dynamic coding method of this embodiment may be a dynamic coding apparatus, and the apparatus may be implemented by software and/or hardware, and the apparatus may be configured in an electronic device, and the electronic device may include, but is not limited to, a terminal, a server, and the like.
Fig. 1 is a schematic flowchart of a dynamic encoding method provided according to an embodiment of the present disclosure, as shown in fig. 1, the method includes:
s101: first coded data transmitted in a first time period and second coded data to be transmitted in a continuous second time period are determined.
The dynamic encoding method provided by the embodiment of the present disclosure may be executed by a data transmitting end in a communication system, where the data transmitting end first determines first encoded data to be transmitted in a first time period and second encoded data to be transmitted in a continuous second time period.
The data transmitted from the transmitting end to the receiving end during the communication process may be referred to as encoded data, and the encoded data may be any type of data, which is related to an application scenario of the communication system, and is not limited thereto.
While the transmitting end is in the first time period t0 The encoded data that has been transmitted may be referred to as first encoded data, which may be, for example, one or more sets of data; and a first time period t0 The next period of time in succession may be referred to as a second period of time t1 The encoded data to be transmitted by the transmitting end in the second time period may be referred to as second encoded data, and the second encoded data may be one set of data or multiple sets of data, which is not limited in this respect.
The first encoded data may be encoded by using a fixed initial bit number, and the second encoded data is encoded by using a dynamic bit number, that is, the encoding bit number of the second encoded data may be dynamically adjusted in this embodiment.
In a specific application scenario, the dynamic encoding method provided by the embodiment of the present disclosure may be applied to a mine edge computing system, for example, fig. 2 is a schematic structural diagram of the edge computing system provided by the embodiment of the present disclosure, and as shown in fig. 2, the mine edge computing system may be composed of a plurality of edge computing devices (i.e., terminal devices) and an integrated management and control platform system, where each terminal device communicates with the integrated management and control platform system, and the terminal devices may communicate with each other to perform data transmission. The dynamic encoding method may be performed by a data sender in an edge computing system, for example, and each terminal device may serve as the sender or the receiver. Fig. 3 is a schematic structural diagram of a terminal device in a communication system according to an embodiment of the present disclosure, and as shown in fig. 3, a sending end includes a sampling module, a quantization module, a coding module, and a transmit receive module (TX/RX module), and may perform coding transmission on data sampled by the sending end, and in addition, the sending end is further provided with an edge calculation module, and may perform dynamic coding according to a coding rule, that is, part or all of steps of the dynamic coding method according to this embodiment may be performed by the edge calculation module. Correspondingly, the receiving end comprises a transmitting and receiving module (TX/RX module), a decoding module, a verification module, a restoration module and an edge calculation module, and can decode and restore the coded data sent by the sending end.
For example, a transmitting end (terminal device) may be connected to a downhole sensor, the sensor may collect environmental data (e.g., temperature, humidity, gas data, etc.) in a mine, and the transmitting end may perform operations such as quantization and encoding on the environmental data to obtain encoded data, and transmit the encoded data to a receiving end. Wherein, the sending end is in the first time period t0 The encoded data of the plurality of sets of environmental data that have been transmitted may be referred to as first encoded data, and at the second time period t1 The encoded data that has not been transmitted is referred to as second encoded data. In this case, the transmitting end (more)In particular, an edge calculation module of the transmitting end) may determine the first encoded data and the second encoded data.
S102: target data in the second encoded data that is the same as the first encoded data is determined.
For example, the first encoded data may include, for example, sets of data such as a1, a2, a3, an, etc., and the second encoded data may include, for example, b1, b2, b3, a, bn, in some embodiments, the same data may be present in the first encoded data and the second encoded data, such as: b2 is the same as a2, that is, the environmental data collected in the first time period and the second time period have the same data, then b2 and a2 may be referred to as target data. It is understood that one or more sets of the same target data may exist in the second encoded data and the first encoded data, which is not limited thereto.
S103: and determining the target bit number according to the transmission frequency of the target data in the first coded data.
After the first encoded data and the second encoded data are determined, further, the edge calculation module of the sending end may determine the target bit number according to the sending frequency occupied by the target data in the first encoded data.
The transmission frequency is used to describe a ratio of the target data in the first encoded data, for example: first time period t0 A total of 10 first encoded data sets (i.e., 10 transmissions) are transmitted, wherein 2 target data a2 are transmitted (i.e., twice), and the transmission frequency is 2 × 10 — 0.2.
The number of bits, which may also be expressed as a bit length, is used to express the bits required to encode the sampled data (environmental data), such as: each group of data in the first coded data adopts 3-bit coding. And the number of bits employed for re-encoding the target data in the second encoded data may be referred to as a target number of bits.
Wherein the target bit number may be determined according to a transmission frequency of target data in the first encoded data.
In some embodiments, the transmission frequency may be compared to a set threshold, and if the transmission frequency is greater than the set threshold, then: the target data is a high frequency event, and the target bit number determined in this case is less than the initial bit number used to encode the target data for the first time period, i.e., the target bit number is a shorter bit. The set threshold may be flexibly set according to the actual application scenario, which is not limited to this.
For example, the first time period t0 The initial number of bits used to encode the target data a2 is 5 bits, namely: if the transmission frequency is 0.2 and the threshold is set to 0.15, the determined target bit number may be smaller than the initial bit number, and the target bit number may be, for example, 4 bits.
In other embodiments, if the transmission frequency is less than the set threshold, it indicates that the target data is a low-frequency event that is not frequently transmitted, which may be an important abnormal event, in this case, the determined target bit number may be greater than the initial bit number used for encoding the target data in the first time period, that is, the target bit number is a longer bit, so as to facilitate timely discovery of the abnormal event.
For example, the first time period t0 The initial number of bits used to encode the target data a2 is 5 bits, namely: 5 bits, and in the case that the transmission frequency is 0.2 and the set threshold is 0.3, the determined target bit number may be greater than the initial bit number, for example: 6 bit.
It should be noted that, in order to ensure lossless transmission of information, the target number of bits in this embodiment is not less than the entropy of the encoded information, and the calculation formula of the entropy of the information is, for example
In some embodiments, the sending end makes a decision on the sending frequency by using a pre-trained decision tree model to determine a target bit number, wherein the decision tree model is constructed based on the frequency characteristics of the encoded data sent by the sending end.
Specifically, after the sending end sends the encoded data, the sent encoded data may be used as a training sample of the decision tree, and the frequency of the encoded data is used as a feature of the decision tree, for example: according to the frequency characteristics of less than 50%, less than 25%, less than 20% of the transmission frequency and the like as the characteristics of the decision tree, the target bit number is used as the classification result, for example: the frequency is less than 50% and less than 25% and adopts 4bit, and the specific feature selection and classification result can be flexibly set according to the practical application, and the method is not limited. And then training the decision tree by adopting the training samples until the decision tree is not increased to obtain the decision tree model. In the process of determining the target bit number, a decision tree model can be adopted to make a decision on the sending frequency and output a classification result of the target bit number. Therefore, the target bit number can be determined quickly and accurately by adopting the decision tree model.
S104: target data is re-encoded using the target number of bits.
That is, the transmitting end (encoding module) may re-encode the target data in the second time period by using the target bit number, that is, the dynamic bit number may be the target bit number, so as to dynamically encode the target data to obtain the corresponding second encoded data. The method comprises the following steps of dynamically coding abnormal events with small probability by adopting a long bit number so as to ensure that the abnormal events can be timely and accurately found; and for the high-probability event, the dynamic coding is carried out by adopting a shorter bit number so as to reduce the number of invalid bit bits in the communication process.
In some embodiments, the total number of bits of the re-encoded second encoded data is not greater than the total number of bits of the first encoded data, that is, the total number of bits of the encoded data transmitted in the second time period is less than or equal to the total number of bits of the encoded data transmitted in the first time period. Therefore, in the process that the sending end (the transmitting and receiving module) sends the second coded data of the second time period to the receiving end, the transmission bandwidth can be saved.
In some embodiments, the sending end may further send the decision tree model and the encoding rule (i.e., the target bit number) of the target data to the receiving end, so that the receiving end may perform a decoding operation according to the encoding rule. In addition, the receiving end can also combine the decision tree model with the decision tree model trained by the receiving end, and under the condition that the receiving end is used as the transmitting end, the combined decision tree model can avoid the over-fitting condition.
In this embodiment, first encoded data sent in a first time period and second encoded data to be sent in a continuous second time period are determined, where the first encoded data is encoded by using a fixed initial bit number, the second encoded data is encoded by using a dynamic bit number, target data in the second encoded data, which is the same as the first encoded data, is determined, and a target bit number is determined according to a sending frequency occupied by the target data in the first encoded data, where the target bit number is smaller than the initial bit number when the sending frequency is greater than a set threshold, and otherwise, the target bit number is greater than the initial bit number; and recoding the target data by adopting the target bit number, wherein the total bit number of the recoded second coded data is not more than that of the first coded data, the same information sent at high frequency can be coded by using shorter bits to reduce invalid information coding in the communication process, the abnormal information sent at low frequency can be coded by using longer bits to ensure that the abnormal information is found in time, and the bandwidth of the data sent in the second time period can be saved, so that the efficiency of subsequent decision and scheduling can be improved.
Fig. 4 is a schematic flowchart of a dynamic encoding method according to another embodiment of the present disclosure, as shown in fig. 4, the method includes:
s401: first coded data transmitted in a first time period and second coded data to be transmitted in a continuous second time period are determined.
S402: target data in the second encoded data that is the same as the first encoded data is determined.
The descriptions of S401 to S402 may specifically refer to the above embodiments, and are not described herein again.
S403: and receiving a decision forest model issued by the equipment management platform, wherein the decision forest model is constructed by decision tree models trained by a plurality of sending ends.
In the embodiment of the present disclosure, as shown in fig. 2, after a plurality of sending ends (i.e., terminal devices) have trained their own decision tree models, the multiple sending ends may send the decision tree models to an equipment management platform (i.e., a comprehensive management and control platform system), for example: the decision tree model is uniformly uploaded to a comprehensive management and control platform through an EIP protocol, the equipment management platform can perform uniform calculation, the decision tree models trained by a plurality of sending ends are constructed into decision forest models, and the decision forest models are issued to each terminal equipment. In this case, the terminal device may receive the decision forest model issued by the device management platform (i.e., the integrated management and control platform system).
S404: and replacing the decision tree model with a decision forest model, and adopting the decision forest model to make a decision on the sending frequency to determine the target bit number.
That is, the sending end uses the decision forest model to replace the decision tree model to make a decision on the sending frequency and determine the target bit number.
Thus, each terminal device can have a uniform number of model decision target bits, and the decision forest model can prevent the phenomenon of over-fitting compared to the decision tree model.
S405: target data is re-encoded using the target number of bits.
For the description of S405, reference may be made to the above embodiments, which are not described herein again.
In this embodiment, first encoded data sent in a first time period and second encoded data to be sent in a continuous second time period are determined, where the first encoded data is encoded by using a fixed initial bit number, the second encoded data is encoded by using a dynamic bit number, target data in the second encoded data, which is the same as the first encoded data, is determined, and a target bit number is determined according to a sending frequency occupied by the target data in the first encoded data, where the target bit number is smaller than the initial bit number when the sending frequency is greater than a set threshold, and otherwise, the target bit number is greater than the initial bit number; and recoding the target data by adopting the target bit number, wherein the total bit number of the recoded second coded data is not more than that of the first coded data, the same information transmitted at high frequency can be coded by using shorter bits to reduce invalid information coding in the communication process, the abnormal information transmitted at low frequency can be coded by using longer bits to ensure timely discovery, the bandwidth of transmitting data in a second time period can be saved, and the subsequent decision and scheduling efficiency can be improved. Furthermore, each terminal device may have a uniform model decision target bit number, and the decision forest model may prevent the phenomenon of over-fitting compared to the decision tree model.
In practical applications, the dynamic encoding process is as follows:
(1) for the edge computing system of FIG. 2, the following steps are included:
s1, each terminal device generates a self coding classification model through a decision tree model according to the information coding data received by the terminal device.
S2, uniformly uploading the generated information coding data to a comprehensive control platform through an EIP protocol for uniform model calculation to form a decision forest (a decision tree on each device is re-optimized to form the decision forest, a uniform model can prevent the overfitting phenomenon of a single device model)
And S3, sending the model generated by the comprehensive control platform system to each terminal device, classifying the received data according to the received model by the terminal device, and recoding the information codes which are sent again and appear at the same high frequency by using the short bit length, and recoding the information codes which are sent again and appear at the same low frequency by using the long bit length.
(2) For the transmitting end and the receiving end of fig. 3, the following steps are included:
s1, at a sending end, for a certain time period t0 And carrying out self-learning classification on the sent information coding data by using a decision tree algorithm, and establishing a decision tree by taking the probability distribution size of each information coding as a characteristic value.
S2, at a receiving end, aiming at a certain time period t0 In step S1, the above step is performed for the received dataThe same operation is performed and the coding of the received erroneous information is also added to the decision tree.
S3, at the transmitting end, t is described for S1 and S20 For the next time period t1 For t1 Coding and t of information transmitted in a time period0 The information coding in the time is the same, and can be according to t0 The decision tree generated in the time interval is used for the t1 And (4) making a decision on the information coding in the time interval, and recoding according to the rule of the second half of the step (1) S3. And recording the old rule of the original information coding, and sending the new rule of the information coding, namely the decision tree model, as the basis of classification to the receiving end through the protocol format of EIP.
S4, at the receiving end, for the next time period t to which S3 belongs1 And merging the decision tree model formed during the terminal sending with the received decision tree model.
And S5, uniformly sending the finally combined decision tree to a comprehensive control platform system through an EIP (enhanced information platform) protocol by each terminal, and forming a uniform decision tree forest together with (1) S2.
S6, continuously iterating the steps S1-S5 until the decision tree does not grow or the time period t is withinn The decision tree of the equipment is replaced by the decision forest of the control instruction of the comprehensive control platform system to indicate that the convergence of the process is finished.
In order to implement the above embodiments, the present disclosure further provides a dynamic encoding apparatus.
Fig. 5 is a schematic diagram of a dynamic encoding apparatus provided according to an embodiment of the present disclosure.
As shown in fig. 5, the dynamic encoding apparatus 50 includes:
a first determining module 501, configured to determine first encoded data sent in a first time period and second encoded data to be sent in a second continuous time period, where the first encoded data is encoded by using a fixed initial bit number, and the second encoded data is encoded by using a dynamic bit number;
a second determining module 502, configured to determine target data in the second encoded data that is the same as the first encoded data;
a third determining module 503, configured to determine a target bit number according to a transmission frequency occupied by the target data in the first encoded data, where the target bit number is smaller than the initial bit number when the transmission frequency is greater than a set threshold, and otherwise the target bit number is greater than the initial bit number; and
and an encoding module 504, configured to re-encode the target data with a target bit number, where a total bit number of the re-encoded second encoded data is not greater than a total bit number of the first encoded data.
In some embodiments, the third determining module 503 is specifically configured to:
and deciding the sending frequency by adopting a pre-trained decision tree model, and determining the target bit number, wherein the decision tree model is constructed on the basis of the frequency characteristics of the coded data sent by the sending end.
In some embodiments, the apparatus 50 further comprises:
the receiving module is used for receiving a decision forest model issued by the equipment management platform, wherein the decision forest model is constructed by decision tree models trained by a plurality of sending ends;
moreover, the third determining module 503 is specifically configured to: and replacing the decision tree model with a decision forest model, and adopting the decision forest model to make a decision on the sending frequency to determine the target bit number.
In some embodiments, the apparatus 50 further comprises: and the first sending module is used for sending the decision tree model to the equipment management platform.
In some embodiments, the apparatus 50 further comprises: and the second sending module is used for sending the second coded data and the decision tree model to the receiving end.
The functions and specific implementation principles of the modules in the embodiments of the present disclosure may refer to the embodiments of the methods, and are not described herein again.
The dynamic coding device of the embodiment determines first coded data sent in a first time period and second coded data sent in a continuous second time period, wherein the first coded data are coded by using a fixed initial bit number, the second coded data are coded by using a dynamic bit number, target data in the second coded data, which are the same as the first coded data, are determined, and a target bit number is determined according to a sending frequency occupied by the target data in the first coded data, wherein the target bit number is smaller than the initial bit number under the condition that the sending frequency is greater than a set threshold value, otherwise, the target bit number is greater than the initial bit number; and recoding the target data by adopting the target bit number, wherein the total bit number of the recoded second coded data is not more than that of the first coded data, the same information sent at high frequency can be coded by using shorter bits to reduce invalid information coding in the communication process, the abnormal information sent at low frequency can be coded by using longer bits to ensure that the abnormal information is found in time, and the bandwidth of the data sent in the second time period can be saved, so that the efficiency of subsequent decision and scheduling can be improved.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
In order to implement the foregoing embodiments, the present disclosure further provides a computer program product, which when executed by an instruction processor in the computer program product, performs the dynamic encoding method as set forth in the foregoing embodiments of the present disclosure.
FIG. 6 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present disclosure. Theelectronic device 12 shown in fig. 6 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present disclosure.
As shown in FIG. 6,electronic device 12 is embodied in the form of a general purpose computing device. The components ofelectronic device 12 may include, but are not limited to: one or more processors orprocessing units 16, asystem memory 28, and abus 18 that couples various system components including thesystem memory 28 and theprocessing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. These architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus, to name a few.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible byelectronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/orcache Memory 32. Theelectronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only,storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive").
Although not shown in FIG. 6, a disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read Only Memory (CD-ROM), a Digital versatile disk Read Only Memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected tobus 18 by one or more data media interfaces.Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.
A program/utility 40 having a set (at least one) ofprogram modules 42 may be stored, for example, inmemory 28,such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment.Program modules 42 generally perform the functions and/or methodologies of the embodiments described in this disclosure.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device,display 24, etc.), with one or more devices that enable a user to interact withelectronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enableelectronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O)interface 22. Also, theelectronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network such as the Internet) via theNetwork adapter 20. As shown, thenetwork adapter 20 communicates with the other modules of theelectronic device 12 over thebus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction withelectronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Theprocessing unit 16 executes various functional applications, such as implementing the dynamic encoding method mentioned in the foregoing embodiments, by executing programs stored in thesystem memory 28.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present disclosure, "a plurality" means two or more unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present disclosure includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description of the present specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present disclosure have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure, and that changes, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present disclosure.