WO2019196480A1 - Data processing method and apparatus for device - Google Patents

Data processing method and apparatus for device Download PDF

Info

Publication number
WO2019196480A1
WO2019196480A1 PCT/CN2018/121258 CN2018121258W WO2019196480A1 WO 2019196480 A1 WO2019196480 A1 WO 2019196480A1 CN 2018121258 W CN2018121258 W CN 2018121258W WO 2019196480 A1 WO2019196480 A1 WO 2019196480A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
coding table
sub
coding
target device
Prior art date
Application number
PCT/CN2018/121258
Other languages
French (fr)
Chinese (zh)
Inventor
刘华
范佳龙
牟桂贤
申伟刚
苏玉海
李石江
李窑
庞宇燚
Original Assignee
珠海格力电器股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 珠海格力电器股份有限公司 filed Critical 珠海格力电器股份有限公司
Publication of WO2019196480A1 publication Critical patent/WO2019196480A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/52Network services specially adapted for the location of the user terminal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/2823Reporting information sensed by appliance or service execution status of appliance services in a home automation network
    • H04L12/2825Reporting to a device located outside the home and the home network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0014Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the source coding

Definitions

  • the present invention relates to the field of data processing, and in particular to a data processing method and apparatus for a device.
  • DTU Data Transfer Unit
  • the server receives data transmitted by the home appliance through the DTU, and analyzes and processes the data, thereby realizing remote real-time detection and troubleshooting.
  • the DTU transmits data by means of GPRS module to realize wireless communication with the server.
  • the data transmitted by GPRS is charged according to the traffic used for transmission. Therefore, the home appliance will generate a large amount of data transmission between the DTU and the server. cost.
  • At least some embodiments of the present invention provide a data processing method and apparatus for a device to at least solve the technical problem of high transmission cost when a home appliance transmits data through a DTU in the prior art.
  • a data processing method of a device including: acquiring historical data of a target device within a preset time period, wherein the target device is in a preset geographic area; and analyzing historical data. Determining a probability of occurrence of each character in the historical data; generating, according to the probability of occurrence of each character, a sub-coding table for encoding the data to be transmitted of the target device of the preset geographical area in a preset time period, wherein each The probability that a character appears in the historical data is inversely proportional to the length of the corresponding encoded symbol in the sub-code table.
  • a data processing method of a device including: acquiring a first coding table, where the first coding table includes sub-coding of a target device of a preset geographical area in a preset time period.
  • the length of the coded symbol corresponding to the character in the subcode table is inversely proportional to the probability that the character appears in the historical data corresponding to the subcode table; and the data to be transmitted is encoded according to the first code table.
  • a data processing apparatus including: a first acquiring module, configured to acquire historical data of a target device within a preset time period, wherein the target device is in a preset geographic location
  • the analysis module is configured to analyze the historical data to determine the probability of occurrence of each character in the historical data;
  • the generating module is configured to generate a target device for the preset geographic area according to the probability of occurrence of each character
  • a sub-coding table in which data to be transmitted is encoded in a preset time period, wherein the probability that each character appears in the historical data is inversely proportional to the length of the corresponding encoded symbol in the sub-coding table.
  • a data processing apparatus for a device including: a second obtaining module, configured to acquire a first encoding table, wherein the first encoding table includes a target device of a preset geographic area.
  • the sub-coding table of the preset time period, the length of the encoding symbol corresponding to the character in the sub-coding table is inversely proportional to the probability of occurrence of the character in the historical data corresponding to the sub-coding table; the encoding module is configured to transmit the data according to the first encoding table Encode.
  • a storage medium is further provided, where the storage medium includes a stored program, wherein the target device on which the storage medium is located is controlled to execute the data processing method of the device described above when the program is running.
  • processor configured to execute a program, wherein the program is executed to execute the data processing method of the device.
  • historical data of a target device in a preset time period is acquired, wherein the target device is in a preset geographic area; and historical data is analyzed to determine a probability of occurrence of each character in the historical data; Generating, according to the probability of occurrence of each character, a sub-coding table for encoding the data to be transmitted of the target device of the preset geographical area in a preset time period, wherein the probability and character of each character appearing in the historical data are The length of the corresponding coded symbol in the sub-code table is inversely proportional.
  • the above solution determines the probability of occurrence of each character in the data of the target device in each geographical area in different time periods by using historical data, thereby obtaining the data law of the target device in different geographical regions in different time periods, and then according to this The law determines the corresponding coding symbol for the character, and achieves the purpose of reducing the amount of data.
  • the DTU data transmission cost is fixed, the DTU data transmission cost is reduced, and the transmission cost of the home appliance through the DTU is higher.
  • FIG. 1 is a flow chart of a data processing method of a device according to an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a generated sub-encoding table according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a determination target sub-code table according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of coding a DTU to be transmitted according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a data processing apparatus of a device according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a data processing apparatus of a device according to an embodiment of the present application.
  • an embodiment of a data processing method of a device there is provided an embodiment of a data processing method of a device, and it is noted that the steps illustrated in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer executable instructions, and Although the logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • the target device in this embodiment may be a home appliance such as an air conditioner.
  • the target device is used as an air conditioner.
  • the method includes the following steps:
  • Step S102 Acquire historical data of the target device in a preset time period, where the target device is in the preset geographic area.
  • the preset geographic area may be a specified one or more geographical areas, may be divided according to provinces, or may be divided according to other dimensions; the preset time period may be multiple time periods in one cycle, one The period can be one year, divide the time of one year, get multiple time periods, or divide other time periods into time periods.
  • the above historical data may be historical data in a time period, or may be historical data in a plurality of periods.
  • China can be divided into seven geographical regions: Northeast China, East China, North China, Central China, South China, Southwest China, and Northwest China.
  • the year is divided into spring (March-May), Summer (June-August), and Autumn (9). From November to November and from winter (December to February), in the above steps, air conditioners in seven areas can be obtained in turn. In three years, historical data in four time periods will be obtained. 27 sets of historical data.
  • step S104 the historical data is analyzed to determine the probability of occurrence of each character in the historical data.
  • the character may be a hexadecimal character, which is a character corresponding to the data to be transmitted, and the correspondence between the data to be transmitted and the character is determined by a protocol between the DTU and the processor.
  • the probability that the above characters appear may be the ratio of the number of times a character appears in a set of historical data to the total number of characters in the set of historical data.
  • the data in a time period will have a probability distribution, so the probability of occurrence of each character can be analyzed based on historical data.
  • Step S106 Generate, according to the probability of occurrence of each character, a sub-coding table for encoding the to-be-transmitted data of the target device of the preset geographic area in a preset time period, where the probability of each character appearing in the historical data It is inversely proportional to the length of the corresponding coded symbol in the subcode table.
  • the foregoing sub-coding table may be a Huffman coding table.
  • step S106 when the sub-encoding table of the preset time period is generated according to the probability of occurrence of the character, the short-encoding symbol is assigned to the character with high probability of occurrence, and the probability of occurrence is long. Characters are assigned longer coding symbols, so that the amount of data can be greatly reduced.
  • FIG. 2 is a schematic diagram of generating a sub-encoding table according to an embodiment of the present application.
  • the left side is a character probability distribution
  • the right side is a sub-coding table.
  • the proportion of all characters, that is, the probability of occurrence is 27.4640%, which is the character with the highest probability of occurrence, so the corresponding coded symbol is "10", that is, the shortest one code. symbol.
  • the probability of occurrence is 11.451%, which is the second character with the probability of occurrence, so it corresponds to the code symbol "010".
  • the coded symbols corresponding to other characters in Fig. 2 can be deduced by analogy, and also conform to the law of probability and length of coded symbols.
  • the foregoing embodiment of the present application acquires historical data of the target device in a preset time period, where the target device is in a preset geographic area; analyzing historical data to determine a probability of occurrence of each character in the historical data; Generating, according to the probability of occurrence of each character, a sub-coding table for encoding the data to be transmitted of the target device of the preset geographical area in a preset time period, wherein the probability and character of each character appearing in the historical data are The length of the corresponding coded symbol in the sub-code table is inversely proportional.
  • the above solution determines the probability of occurrence of each character in the data of the target device in each geographical area in different time periods by using historical data, thereby obtaining the data law of the target device in different geographical regions in different time periods, and then according to this The law determines the corresponding coding symbol for the character, and achieves the purpose of reducing the amount of data.
  • the DTU data transmission cost is fixed, the DTU data transmission cost is reduced, and the transmission cost of the home appliance through the DTU is higher.
  • the preset geographic area is multiple, and the preset time period is multiple, and the target device for the preset geographic area is generated according to the probability of occurrence of each character.
  • the method further includes:
  • Step S108 the first coding table is formed by the plurality of sub-coding tables of the plurality of preset time segments according to the target devices of the plurality of preset geographic regions.
  • Step S1010 Write the first encoding table to the data communication unit of the target device, wherein the data communication unit of the target device encodes the data to be transmitted using the first encoding table to obtain an encoding result.
  • the data communication unit may be a DTU, and the DTU has a positioning function, and transmits data to the server through the GPRS.
  • the server is a central server or a central server cluster set at the remote end, and is used for fault maintenance of remote monitoring of the air conditioner according to data transmitted by the DTU.
  • the server sends the first coding table to the DTU, the first coding table is maintained in both the DTU and the server. Therefore, when the DTU sends data, the DTU does not carry the header, and the server can be found according to the decoding.
  • the target sub-code table is decoded.
  • the problem of "small big data in the header" existing in the conventional compression coding mode is solved, so that the data does not need to carry a large header to be transmitted together, thereby further reducing the amount of data to be transmitted. This reduces the cost of data transfer.
  • the method further includes: after the first code table is written into the data communication unit of the target device, according to the foregoing embodiment of the present application, the method further includes:
  • Step S112 Acquire a coding result sent by the data communication unit, a geographical area where the target device is located, and a time period to which the current time belongs.
  • the data processing unit has a positioning function.
  • the data processing unit encodes the data to be transmitted before transmitting the data, it searches for a sub-coding table corresponding to the geographical area where the air conditioner is located and the time period to which the current time belongs (ie, the following The target sub-coding table is encoded. Therefore, when the server receives the encoding result, it also needs to obtain the geographical area where the target device is located and the time period to which the current time belongs, so that it can determine which sub-encoding table is used to decode the encoding result.
  • the encoding result is sent by the data communication unit of the air conditioner and received by the server.
  • the current time may be the time when the server receives the encoded result, and the geographical area where the air conditioner is located may be sent by the data communication unit of the air conditioner.
  • Step S114 Search for a corresponding target sub-code table in the first coding table according to the geographical area where the target device is located and the time period to which the current time belongs.
  • the first coding table includes a sub-coding table of a plurality of preset geographic regions in a plurality of preset time segments, so that one of the two regions of the geographical area and the current time period in which the air-conditioning corresponding to the coding result is located may determine one A target subcode table for decoding the encoded result.
  • the geographical area is two geographical regions of the south and the north
  • the time period includes spring (3- Four periods of May, June (June to August), Autumn (September-November), and Winter (December-February), so a first code table includes 8 sub-code tables, and 8 sub-code tables respectively.
  • a first code table includes 8 sub-code tables, and 8 sub-code tables respectively.
  • the corresponding sub-encoding table in January is Table 4, so after receiving the encoding result, the server decodes the encoding result according to Table 4; Online 2, the corresponding sub-encoding table in August is Table 6, so after receiving the encoding result, the server decodes the encoding result according to Table 6; for the multi-connection 3 located in Shenzhen, the corresponding sub-encoding in April The table is Table 5, so after receiving the encoding result, the server decodes the encoding result according to Table 5.
  • the first encoding table may be stored in a database, and the server searches for a corresponding target sub-coding table from the database for decoding.
  • Step S116 decoding the encoded result according to the target sub-coding table.
  • each sub-coding table in the first coding table is a Huffman coding table, so after determining the target sub-coding table, Huffman coding may be adopted by target sub-coding.
  • the table decodes the encoded result.
  • the method further includes:
  • Step S118 Acquire a preset period, where the period includes a plurality of preset time periods.
  • the habit of using the air conditioner by the user is also changed according to the climate, so the above cycle may be one year.
  • step S120 when one cycle is cut off, the first coding table is optimized according to historical data in the cycle.
  • the above steps optimize the first coding table using the historical data of the most recent cycle.
  • January 2017 is the beginning of a cycle, and by January 2018, the cycle is closed.
  • the server uses the historical data acquired during this period to optimize the first coding table in the previous data transmission unit. As shown in FIG. 3, the server periodically optimizes the first coding table to ensure that the first coding table used for coding and decoding is the optimal coding table.
  • the first coding table is optimized according to historical data in the period, including:
  • Step S121 constructing a second coding table of the period according to the probability that each character appears in the historical data in the period.
  • the second coding table is constructed in the same manner as the first coding table, except that the historical data used is historical data in different periods.
  • Step S125 if the average code length of the second coding table is shorter than the average code length of the first coding table, determine that the second coding table is the first coding table in the next cycle, and send the second coding table to the target device. Data transfer unit.
  • step S125 determining that the second coding table is the first coding table in the next cycle, that is, determining that the second coding table is the current optimal coding table, and in the next cycle, using the second coding table to compile the data. decoding.
  • the entire table of the second coding table may be sent to the data transmission unit of each target device, or the target device may be belonged according to the geographical area to which the target device belongs.
  • the geographical area is sent to the data transmission unit in a sub-coding table of a plurality of preset time periods.
  • the average code length of the second coding table is shorter than the average code length of the first coding table, it indicates that the second coding table is better than the first coding table, that is, the second coding table is the current optimal coding table, and thus the second coding is determined.
  • the table is the first coding table in the next period. If the average code of the second code table is longer than the average code length of the first code table, the first coding table is better than the second coding table, and the first coding table is still not The optimal coding table, so the first coding table is still coded and decoded in the next cycle.
  • the server continues to analyze the second coding table according to the big data to optimize the first coding table, and sends the second coding table to the DTU if the second coding table is better than the first coding table. So that the server and the DTU side dynamically maintain this table and make this table always the optimal coding table.
  • FIG. 4 is a data processing method of a device according to an embodiment of the present application. As shown in Figure 4, the method includes:
  • Step S41 the first coding table is obtained, where the first coding table includes a sub-coding table of the target device of the preset geographic area in a preset time period, and the length of the coding symbol corresponding to the character in the sub-coding table corresponds to the character in the sub-coding table.
  • the probability of occurrence in historical data is inversely proportional.
  • the foregoing first coding table may be constructed by the server according to the historical data, and is written before the DTU leaves the factory.
  • the manner in which the server constructs the first coding table may be to first construct a target device of each preset geographic area in each pre-preparation. Set the rest of the sub-code table, and then combine the multiple sub-code tables into a single table.
  • the manner in which the server constructs the subcode table can be as shown in Embodiment 1.
  • each sub-code table has a corresponding geographical area and a corresponding time period
  • the historical data corresponding to the sub-code table is historical data for constructing the sub-code table, that is, a preset geographical area corresponding to the sub-code table.
  • Step S43 encoding the data to be transmitted according to the first coding table.
  • the data to be transmitted is the data detected by each sensor in the air conditioner acquired by the DTU, and other data that needs to be transmitted to the server.
  • the timing at which the DTU transmits data to the server may be a transmission period set in the DTU for remote monitoring of the operation of the air conditioner by the server, or data transmitted in order to enable the server to perform failure analysis when the air conditioner generates a failure.
  • the foregoing embodiment obtains the first coding table, where the first coding table includes a sub-coding table of the target device of the preset geographic area in a preset time period, and the length of the coding symbol corresponding to the character in the sub-coding table is The probability that the character appears in the historical data corresponding to the sub-code table is inversely proportional, and the data to be transmitted is encoded according to the first coding table.
  • both the server and the DTU maintain a first coding table, and the DTU uses the first coding table to encode the data, thereby reducing the amount of data and solving the transmission of the home appliance when transmitting data through the DTU in the prior art. Higher technical issues.
  • the data to be transmitted is encoded according to the first coding table, including:
  • Step S431 Obtain a geographic area corresponding to the location where the target device is located and a time period to which the current time belongs.
  • Step S433 searching for a corresponding target sub-code table from the first coding table according to the geographical area and the time period.
  • Step S435 encoding the data to be transmitted according to the target sub-coding table.
  • FIG. 3 is a schematic diagram of a determination target sub-coding table according to an embodiment of the present application.
  • the geographical area is two geographical regions of the south and the north
  • the time period includes spring (3-5). Month), summer (June to August), autumn (September-November), and winter (December-February) four time periods
  • a first coding table includes 8 sub-code tables, and 8 sub-code tables are respectively Sub-codes 1, 2, 3, 4 of the air conditioning in the four seasons of spring, summer, autumn and winter and sub-codes 5, 6, 7, and 8 of the four periods of spring, summer, autumn and winter.
  • the corresponding sub-code table in January is Table 4, so the data of the DTU of the multi-line 1 is encoded and transmitted to the server using Table 4;
  • Multi-line 2 the corresponding sub-code table in August is Table 6, so the data of the DTU of the multi-line 1 is encoded and transmitted to the server using Table 6;
  • the multi-line 3 located in Shenzhen corresponding in April
  • the sub-encoding table is shown in Table 5, so the data of the DTU of the multi-line 1 is encoded using Table 5 and transmitted to the server.
  • the method before the encoding the data to be transmitted according to the first encoding table, the method further includes:
  • Step S45 detecting whether a second encoding table sent by the server for updating the first encoding table is received.
  • step S45 if the average code length of the second coding table is shorter than the average code length of the first coding table, the server determines that the second coding table is the first coding table in the next cycle, as shown in step S125. And transmitting the second code table to the data transmission unit of the target device. That is, if the average code length of the second coding table is shorter than the average code length of the first coding table, the DTU receives the second coding table transmitted by the server.
  • Step S47 if the second encoding table is received, the first encoding table is replaced with the second encoding table.
  • the server sends the second coding table to the DTU, it is determined that the second coding table is better than the first coding table, in which case the DTU replaces the first coding table with the second coding table, so that the DTU can always maintain the most Excellent coding table and can always be encoded using the optimal coding table.
  • step S47 when the DTU replaces the first coding table by using the second coding table, the entire table of the second coding table may be replaced with the first coding table, or In the second coding table, the sub-coding table of the geographical area where the air conditioner is located replaces the sub-coding table of the geographical area where the target device is located in the first coding table.
  • the geographical area to which the air conditioner belongs is the East China region. Therefore, when the first coding table is optimized, the second coding table may be used, and the East China region has four children in the four seasons of spring, summer, autumn and winter.
  • the coding table replaces the four sub-code tables of the East China region in the first coding table in the four seasons of spring, summer, autumn and winter.
  • FIG. 5 is a schematic diagram of encoding a DTU to be transmitted according to an embodiment of the present application. As shown in FIG. 5, in an optional embodiment, encoding a DTU to transmit data may include the following steps. :
  • the above time is the time when the DTU is about to encode the data.
  • the above address is the address of the air conditioner.
  • the data collected by the DTU may be data detected by the sensor of the air conditioner.
  • the first code table generated by the DTU is pre-stored.
  • the server may also update the first code table according to the newly generated second code table, so the code table found in the above step is The most recently updated codelist.
  • step S55 Determine whether the current coding table is an optimal coding table. If the determination result is yes, the process proceeds to step S56, otherwise, the process proceeds to step S55.
  • step S55 if the server updates the coding table in the DTU, the original coding table found is not the optimal coding table, and needs to be searched again. If the server does not update the DTU terminal coding table, it finds The coding table is the optimal coding table, and the process proceeds to step S56.
  • the coding table may be Huffman coding, and the coding mode may also use Huffman coding.
  • the DTU transmits the encoded result to the server.
  • the DTUs of the air conditioners of various places transmit data to the server, and the server can perform a new round of statistical analysis on the massive data in addition to monitoring and fault diagnosis of each air conditioner according to the data.
  • the statistical analysis includes spatial analysis (the geographical area to which the air conditioner generating the data belongs), time analysis (time of generating the data), and protocol analysis (the protocol used to generate the data), and comprehensively analyzing the results to generate a new Huffman code.
  • the principle of the judgment is that the newly generated coding Whether the average code length of the table is shorter than the average code length of the original code table.
  • FIG. 6 is a schematic diagram of a data processing apparatus of a device according to an embodiment of the present application. As shown in FIG. 6, the apparatus includes:
  • the first obtaining module 60 is configured to acquire historical data of the target device within a preset time period, where the target device is in the preset geographic area.
  • the analysis module 62 is configured to analyze the historical data to determine the probability of occurrence of each character in the historical data.
  • the generating module 64 is configured to generate, according to the probability of occurrence of each character, a sub-coding table for encoding the data to be transmitted of the target device of the preset geographical area in a preset time period, wherein each character is in the historical data.
  • the probability of occurrence is inversely proportional to the length of the corresponding coded symbol in the subcode table.
  • FIG. 7 is a schematic diagram of a data processing apparatus of a device according to an embodiment of the present application. As shown in FIG. 7, the apparatus includes:
  • the second obtaining module 70 is configured to obtain a first encoding table, where the first encoding table includes a sub-coding table of the target device of the preset geographic area in a preset time period, and the length and character of the encoding symbol corresponding to the characters in the sub-coding table
  • the probability of occurrence in the historical data corresponding to the sub-code table is inversely proportional.
  • the encoding module 72 is configured to encode the data to be transmitted according to the first encoding table.
  • a storage medium includes a stored program, wherein, when the program is running, the data processing method of the device in which the storage medium is executed is executed, or the data of the device in Embodiment 2 is controlled.
  • the storage medium includes a stored program, wherein, when the program is running, the data processing method of the device in which the storage medium is executed is executed, or the data of the device in Embodiment 2 is controlled.
  • a processor for executing a program, wherein the data processing method of the device of Embodiment 1 or the data processing method of the device of Embodiment 2 is executed when the program is running.
  • the disclosed technical contents may be implemented in other manners.
  • the device embodiments described above are only schematic.
  • the division of the unit may be a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .
  • the data processing method and apparatus of the apparatus provided by at least some embodiments of the present application have the following beneficial effects: determining, by historical data, a probability that each target character of each geographical area appears in data of different time periods, thereby Obtaining the data law of the target devices in different geographical regions in different time periods, and then determining the corresponding coding symbols for the characters according to the law, thereby achieving the purpose of reducing the amount of data, and reducing the DTU data transmission cost.
  • the DTU data transmission cost solves the technical problem of high transmission cost when the home appliance transmits data through the DTU in the prior art.

Abstract

The present invention provides a data processing method and apparatus for a device. The method comprises: obtaining historical data of a target device within a preset time period, wherein the target device is located in a preset geographic area; analyzing the historical data to determine the probability of occurrence of each type of characters in the historical data; and generating, according to the probability of occurrence of each type of characters, a sub-coding table for coding data to be transmitted of the target device in the preset geographic area within the preset time period, wherein the probability of occurrence of each type of characters in the historical data is inversely proportional to a corresponding coded symbol length of the characters in the sub-coding table.

Description

设备的数据处理方法和装置Data processing method and device for equipment 技术领域Technical field
本发明涉及数据处理领域,具体而言,涉及一种设备的数据处理方法和装置。The present invention relates to the field of data processing, and in particular to a data processing method and apparatus for a device.
背景技术Background technique
目前的家用电器设备通常会安装DTU(Data Transfer Unit,数据传输单元),用于对家用电器的远程监控和维护。具体的,由服务器接收家用电器通过DTU传输的数据,并对数据进行分析处理,从而实现远程的实时检测和故障排查等功能。Current home appliance equipment usually installs a DTU (Data Transfer Unit) for remote monitoring and maintenance of household appliances. Specifically, the server receives data transmitted by the home appliance through the DTU, and analyzes and processes the data, thereby realizing remote real-time detection and troubleshooting.
而DTU传输数据的方式通常是采用GPRS模块实现与服务器的无线通信,但通过GPRS传输数据是按照传输所使用的流量进行收费的,因此家用电器会由于DTU与服务器之间的数据传输产生大量的费用。The DTU transmits data by means of GPRS module to realize wireless communication with the server. However, the data transmitted by GPRS is charged according to the traffic used for transmission. Therefore, the home appliance will generate a large amount of data transmission between the DTU and the server. cost.
针对现有技术中家电通过DTU传输数据时传输费用较高的问题,目前尚未提出有效的解决方案。In view of the problem of high transmission cost when the home appliance transmits data through the DTU in the prior art, an effective solution has not been proposed yet.
发明内容Summary of the invention
本发明至少部分实施例提供了一种设备的数据处理方法和装置,以至少解决现有技术中家电通过DTU传输数据时传输费用较高的技术问题。At least some embodiments of the present invention provide a data processing method and apparatus for a device to at least solve the technical problem of high transmission cost when a home appliance transmits data through a DTU in the prior art.
在本发明其中一实施例中,提供了一种设备的数据处理方法,包括:获取目标设备在预设时间段内的历史数据,其中,目标设备处于预设地理区域内;对历史数据进行分析,确定历史数据中每种字符出现的概率;根据每种字符出现的概率,生成用于对预设地理区域的目标设备在预设时间段的待传输数据进行编码的子编码表,其中,每种字符在历史数据中出现的概率与字符在子编码表中对应的编码符号长度呈反比例关系。In an embodiment of the present invention, a data processing method of a device is provided, including: acquiring historical data of a target device within a preset time period, wherein the target device is in a preset geographic area; and analyzing historical data. Determining a probability of occurrence of each character in the historical data; generating, according to the probability of occurrence of each character, a sub-coding table for encoding the data to be transmitted of the target device of the preset geographical area in a preset time period, wherein each The probability that a character appears in the historical data is inversely proportional to the length of the corresponding encoded symbol in the sub-code table.
在本发明其中一实施例中,还提供了一种设备的数据处理方法,包括:获取第一编码表,其中,第一编码表包括预设地理区域的目标设备在预设时间段的子编码表,子编码表中字符对应的编码符号长度与字符在子编码表对应的历史数据中出现的概率呈反比例关系;根据第一编码表对待传输数据进行编码。In an embodiment of the present invention, a data processing method of a device is further provided, including: acquiring a first coding table, where the first coding table includes sub-coding of a target device of a preset geographical area in a preset time period. In the table, the length of the coded symbol corresponding to the character in the subcode table is inversely proportional to the probability that the character appears in the historical data corresponding to the subcode table; and the data to be transmitted is encoded according to the first code table.
在本发明其中一实施例中,还提供了一种设备的数据处理装置,包括:第一获取模块,设置为获取目标设备在预设时间段内的历史数据,其中,目标设备处于预设地理区域内;分析模块,设置为对历史数据进行分析,确定历史数据中每种字符出现的 概率;生成模块,设置为根据每种字符出现的概率,生成用于对预设地理区域的目标设备在预设时间段的待传输数据进行编码的子编码表,其中,每种字符在历史数据中出现的概率与字符在子编码表中对应的编码符号长度呈反比例关系。In an embodiment of the present invention, a data processing apparatus is provided, including: a first acquiring module, configured to acquire historical data of a target device within a preset time period, wherein the target device is in a preset geographic location The analysis module is configured to analyze the historical data to determine the probability of occurrence of each character in the historical data; the generating module is configured to generate a target device for the preset geographic area according to the probability of occurrence of each character A sub-coding table in which data to be transmitted is encoded in a preset time period, wherein the probability that each character appears in the historical data is inversely proportional to the length of the corresponding encoded symbol in the sub-coding table.
在本发明其中一实施例中,还提供了一种设备的数据处理装置,包括:第二获取模块,设置为获取第一编码表,其中,第一编码表包括预设地理区域的目标设备在预设时间段的子编码表,子编码表中字符对应的编码符号长度与字符在子编码表对应的历史数据中出现的概率呈反比例关系;编码模块,设置为根据第一编码表对待传输数据进行编码。In an embodiment of the present invention, a data processing apparatus for a device is provided, including: a second obtaining module, configured to acquire a first encoding table, wherein the first encoding table includes a target device of a preset geographic area. The sub-coding table of the preset time period, the length of the encoding symbol corresponding to the character in the sub-coding table is inversely proportional to the probability of occurrence of the character in the historical data corresponding to the sub-coding table; the encoding module is configured to transmit the data according to the first encoding table Encode.
在本发明其中一实施例中,还提供了一种存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在目标设备执行上述的设备的数据处理方法。In an embodiment of the present invention, a storage medium is further provided, where the storage medium includes a stored program, wherein the target device on which the storage medium is located is controlled to execute the data processing method of the device described above when the program is running.
在本发明其中一实施例中,还提供了一种处理器,处理器用于运行程序,其中,程序运行时执行上述的设备的数据处理方法。In an embodiment of the present invention, there is further provided a processor, wherein the processor is configured to execute a program, wherein the program is executed to execute the data processing method of the device.
在本发明至少部分实施例中,获取目标设备在预设时间段内的历史数据,其中,目标设备处于预设地理区域内;对历史数据进行分析,确定历史数据中每种字符出现的概率;根据每种字符出现的概率,生成用于对预设地理区域的目标设备在预设时间段的待传输数据进行编码的子编码表,其中,每种字符在历史数据中出现的概率与字符在子编码表中对应的编码符号长度呈反比例关系。上述方案通过历史数据确定每个地理区域的目标设备在不同时间段的数据中每种字符出现的概率,从而获取到不同地理区域的目标设备在不同时间段内出现的数据规律,进而根据这一规律为字符确定对应的编码符号,达到了降低数据量的目的,在DTU数据传输费用一定的情况下,降低了DTU数据传输费用,解决了现有技术中家电通过DTU传输数据时传输费用较高的技术问题。In at least some embodiments of the present invention, historical data of a target device in a preset time period is acquired, wherein the target device is in a preset geographic area; and historical data is analyzed to determine a probability of occurrence of each character in the historical data; Generating, according to the probability of occurrence of each character, a sub-coding table for encoding the data to be transmitted of the target device of the preset geographical area in a preset time period, wherein the probability and character of each character appearing in the historical data are The length of the corresponding coded symbol in the sub-code table is inversely proportional. The above solution determines the probability of occurrence of each character in the data of the target device in each geographical area in different time periods by using historical data, thereby obtaining the data law of the target device in different geographical regions in different time periods, and then according to this The law determines the corresponding coding symbol for the character, and achieves the purpose of reducing the amount of data. When the DTU data transmission cost is fixed, the DTU data transmission cost is reduced, and the transmission cost of the home appliance through the DTU is higher. Technical problem.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1是根据本申请其中一实施例的设备的数据处理方法的流程图;1 is a flow chart of a data processing method of a device according to an embodiment of the present application;
图2是根据本申请其中一实施例的一种生成子编码表的示意图;2 is a schematic diagram of a generated sub-encoding table according to an embodiment of the present application;
图3是根据本申请其中一是实施例的一种确定目标子编码表的示意图;3 is a schematic diagram of a determination target sub-code table according to an embodiment of the present application;
图4是根据本申请其中一实施例的一种设备的数据处理方法;4 is a data processing method of a device according to an embodiment of the present application;
图5是根据本申请其中一实施例的一种DTU对待传输数据进行编码的示意图;FIG. 5 is a schematic diagram of coding a DTU to be transmitted according to an embodiment of the present application; FIG.
图6是根据本申请其中一实施例的设备的数据处理装置的示意图;以及6 is a schematic diagram of a data processing apparatus of a device according to an embodiment of the present application;
图7是根据本申请其中一实施例的一种设备的数据处理装置的示意图。FIG. 7 is a schematic diagram of a data processing apparatus of a device according to an embodiment of the present application.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is an embodiment of the invention, but not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of the present invention.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It is to be understood that the terms "first", "second" and the like in the specification and claims of the present invention are used to distinguish similar objects, and are not necessarily used to describe a particular order or order. It is to be understood that the data so used may be interchanged where appropriate, so that the embodiments of the invention described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "comprises" and "comprises" and "the" and "the" are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to Those steps or units may include other steps or units not explicitly listed or inherent to such processes, methods, products or devices.
实施例1Example 1
根据本发明实施例,提供了一种设备的数据处理方法的实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present invention, there is provided an embodiment of a data processing method of a device, and it is noted that the steps illustrated in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer executable instructions, and Although the logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
图1是根据本发明其中一实施例的设备的数据处理方法的流程图,本实施例中的目标设备可以为空调等家用电器,在本申请下述实施例中,以目标设备为空调进行说明。如图1所示,该方法包括如下步骤:1 is a flowchart of a data processing method of a device according to an embodiment of the present invention. The target device in this embodiment may be a home appliance such as an air conditioner. In the following embodiments of the present application, the target device is used as an air conditioner. . As shown in FIG. 1, the method includes the following steps:
步骤S102,获取目标设备在预设时间段内的历史数据,其中,目标设备处于预设地理区域内。Step S102: Acquire historical data of the target device in a preset time period, where the target device is in the preset geographic area.
具体的,上述预设地理区域可以为指定的一个或多个地理区域,可以按照省份进行划分,也可以按照其他维度进行划分;上述预设时间段可以为一个周期内的多个时间段,一个周期可以为一年,对一年的时间进行划分,得到多个时间段,也可以是其他维度对时间周期进行划分。上述历史数据可以是一个时间周期内的历史数据,也可 以是多个周期内的历史数据。Specifically, the preset geographic area may be a specified one or more geographical areas, may be divided according to provinces, or may be divided according to other dimensions; the preset time period may be multiple time periods in one cycle, one The period can be one year, divide the time of one year, get multiple time periods, or divide other time periods into time periods. The above historical data may be historical data in a time period, or may be historical data in a plurality of periods.
由于我国存在地域的客观差异,导致不同地域的家电(例如:空调)使用习惯的不同;由此导致的数据通信单元(DTU)采集到的数据根据地域存在一定规律的概率分布,并且随着一年内四季的更替,使得用户使用空调的习惯在时间上也存在一定规律的概率分布;因此在同一个地点,不同季节的使用方式也存在一定的差别,因此在一种可选的实施例中,可以将中国划分为东北、华东、华北、华中、华南、西南以及西北这七个地理区域,将一年的时间划分为春(3-5月)、夏(6至8月)、秋(9-11月)以及冬(12-2月)这四个时间段,因此在上述步骤中,可以依次获取七个区域的空调,在三年内,分别在四个时间段的历史数据,即会得到27组历史数据。Due to the geographical differences in China, the usage habits of household appliances (such as air conditioners) in different regions are different; the data collected by the data communication unit (DTU) is distributed according to the probability of a certain region, and The replacement of the four seasons in the year makes the user's habit of using air conditioners have a certain regular probability distribution in time; therefore, there are certain differences in the usage patterns of different seasons in the same place, so in an alternative embodiment, China can be divided into seven geographical regions: Northeast China, East China, North China, Central China, South China, Southwest China, and Northwest China. The year is divided into spring (March-May), Summer (June-August), and Autumn (9). From November to November and from winter (December to February), in the above steps, air conditioners in seven areas can be obtained in turn. In three years, historical data in four time periods will be obtained. 27 sets of historical data.
需要说明的是,上述七个地理区域和四个时间段仅用于示例,具体如何划分地理区域和时间段本申请不做具体限定。It should be noted that the above seven geographical areas and four time periods are only used for examples, and how to divide the geographical area and the time period is not specifically limited.
步骤S104,对历史数据进行分析,确定历史数据中每种字符出现的概率。In step S104, the historical data is analyzed to determine the probability of occurrence of each character in the historical data.
具体的,上述字符可以为十六进制的字符,为待传输数据对应的字符,待传输数据与字符的对应关系由DTU与处理器之间的协议确定。Specifically, the character may be a hexadecimal character, which is a character corresponding to the data to be transmitted, and the correspondence between the data to be transmitted and the character is determined by a protocol between the DTU and the processor.
上述字符出现的概率可以为字符在一组历史数据中出现的次数占该组历史数据中所有字符数量的比例。The probability that the above characters appear may be the ratio of the number of times a character appears in a set of historical data to the total number of characters in the set of historical data.
对于同一个地理区域的空调,在一个时间段内的数据会具有一个的概率分布,因此可以根据历史数据分析每种字符出现的概率。For air conditioners in the same geographical area, the data in a time period will have a probability distribution, so the probability of occurrence of each character can be analyzed based on historical data.
步骤S106,根据每种字符出现的概率,生成用于对预设地理区域的目标设备在预设时间段的待传输数据进行编码的子编码表,其中,每种字符在历史数据中出现的概率与字符在子编码表中对应的编码符号长度呈反比例关系。Step S106: Generate, according to the probability of occurrence of each character, a sub-coding table for encoding the to-be-transmitted data of the target device of the preset geographic area in a preset time period, where the probability of each character appearing in the historical data It is inversely proportional to the length of the corresponding coded symbol in the subcode table.
具体的,上述子编码表可以为哈夫曼(Huffman)编码表。Specifically, the foregoing sub-coding table may be a Huffman coding table.
在上述步骤S106中,在根据字符出现的概率为在预设地理区域的目标设备生成预设时间段的子编码表时,对出现概率高的字符分配较短的编码符号,对出现概率长的字符分配较长的编码符号,从而使得数据量能够大幅度减少。In the foregoing step S106, when the sub-encoding table of the preset time period is generated according to the probability of occurrence of the character, the short-encoding symbol is assigned to the character with high probability of occurrence, and the probability of occurrence is long. Characters are assigned longer coding symbols, so that the amount of data can be greatly reduced.
图2是根据本申请其中一实施例的一种生成子编码表的示意图,结合图2所示,左侧为字符概率分布,右侧为一个子编码表。在一组历史数据中,对于字符“00”,占所有字符的比例,即出现的概率为27.4640%,为出现概率最大的字符,因此其对应得编码符号为“10”,即最短的一个编码符号。对于字符“AA”,其出现的概率为11.451%,为出现概率第二的字符,因此其对应得编码符号为“010”。图2中其他字符对应的编码符号可以以此类推,也符合概率与编码符号长度的规律。FIG. 2 is a schematic diagram of generating a sub-encoding table according to an embodiment of the present application. As shown in FIG. 2, the left side is a character probability distribution, and the right side is a sub-coding table. In a set of historical data, for the character "00", the proportion of all characters, that is, the probability of occurrence is 27.4640%, which is the character with the highest probability of occurrence, so the corresponding coded symbol is "10", that is, the shortest one code. symbol. For the character "AA", the probability of occurrence is 11.451%, which is the second character with the probability of occurrence, so it corresponds to the code symbol "010". The coded symbols corresponding to other characters in Fig. 2 can be deduced by analogy, and also conform to the law of probability and length of coded symbols.
由上可知,本申请上述实施例获取目标设备在预设时间段内的历史数据,其中,目标设备处于预设地理区域内;对历史数据进行分析,确定历史数据中每种字符出现的概率;根据每种字符出现的概率,生成用于对预设地理区域的目标设备在预设时间段的待传输数据进行编码的子编码表,其中,每种字符在历史数据中出现的概率与字符在子编码表中对应的编码符号长度呈反比例关系。上述方案通过历史数据确定每个地理区域的目标设备在不同时间段的数据中每种字符出现的概率,从而获取到不同地理区域的目标设备在不同时间段内出现的数据规律,进而根据这一规律为字符确定对应的编码符号,达到了降低数据量的目的,在DTU数据传输费用一定的情况下,降低了DTU数据传输费用,解决了现有技术中家电通过DTU传输数据时传输费用较高的技术问题。As can be seen from the above, the foregoing embodiment of the present application acquires historical data of the target device in a preset time period, where the target device is in a preset geographic area; analyzing historical data to determine a probability of occurrence of each character in the historical data; Generating, according to the probability of occurrence of each character, a sub-coding table for encoding the data to be transmitted of the target device of the preset geographical area in a preset time period, wherein the probability and character of each character appearing in the historical data are The length of the corresponding coded symbol in the sub-code table is inversely proportional. The above solution determines the probability of occurrence of each character in the data of the target device in each geographical area in different time periods by using historical data, thereby obtaining the data law of the target device in different geographical regions in different time periods, and then according to this The law determines the corresponding coding symbol for the character, and achieves the purpose of reducing the amount of data. When the DTU data transmission cost is fixed, the DTU data transmission cost is reduced, and the transmission cost of the home appliance through the DTU is higher. Technical problem.
可选的,根据本申请上述实施例,预设地理区域为多个,预设时间段为多个,在根据每种字符出现的概率,生成用于对预设地理区域的目标设备在预设时间段的待传输数据进行编码的子编码表之后,上述方法还包括:Optionally, according to the foregoing embodiment of the present application, the preset geographic area is multiple, and the preset time period is multiple, and the target device for the preset geographic area is generated according to the probability of occurrence of each character. After the sub-coding table of the data to be transmitted in the time period is encoded, the method further includes:
步骤S108,根据多个预设地理区域的目标设备在多个预设时间段的多个子编码表构成第一编码表。Step S108, the first coding table is formed by the plurality of sub-coding tables of the plurality of preset time segments according to the target devices of the plurality of preset geographic regions.
步骤S1010,将第一编码表写入目标设备的数据通信单元,其中,目标设备的数据通信单元使用第一编码表对待传输数据编码,得到编码结果。Step S1010: Write the first encoding table to the data communication unit of the target device, wherein the data communication unit of the target device encodes the data to be transmitted using the first encoding table to obtain an encoding result.
具体的,上述数据通信单元可以为DTU,DTU具有定位功能,并通过GPRS向服务器传输数据。服务器为设置在远端的中心服务器或中心服务器集群,用于根据DTU传输的数据对空调进行远程监控的故障维护。Specifically, the data communication unit may be a DTU, and the DTU has a positioning function, and transmits data to the server through the GPRS. The server is a central server or a central server cluster set at the remote end, and is used for fault maintenance of remote monitoring of the air conditioner according to data transmitted by the DTU.
在空调出厂时,并不能知晓空调被销往何处,因此将所有的子编码表构成一个第一编码表,将第一子编码表写入数据通信单元,该第一编码表即为当前的最优编码表。When the air conditioner is shipped from the factory, it is not known where the air conditioner is sold, so all the sub-code tables are formed into a first code table, and the first sub-code table is written into the data communication unit, and the first code table is the current one. Optimal coding table.
需要注意的是,由于服务器将第一编码表发送给了DTU,使得DTU和服务器中都维护有第一编码表,因此DTU在发送数据时,可以不携带表头,服务器解码时可以根据找到的目标子编码表进行解码。尤其当DTU需要进行少量数据上报的时候,解决了传统的压缩编码方式存在的“表头大数据少”的问题,使得数据不用携带大表头一起传输,从而进一步减少了需要传输的数据量,进而降低了数据传输所需的费用。It should be noted that since the server sends the first coding table to the DTU, the first coding table is maintained in both the DTU and the server. Therefore, when the DTU sends data, the DTU does not carry the header, and the server can be found according to the decoding. The target sub-code table is decoded. In particular, when the DTU needs to perform a small amount of data reporting, the problem of "small big data in the header" existing in the conventional compression coding mode is solved, so that the data does not need to carry a large header to be transmitted together, thereby further reducing the amount of data to be transmitted. This reduces the cost of data transfer.
可选的,根据本申请上述实施例,在将第一编码表写入目标设备的数据通信单元之后,上述方法还包括:Optionally, the method further includes: after the first code table is written into the data communication unit of the target device, according to the foregoing embodiment of the present application, the method further includes:
步骤S112,获取数据通信单元发送的编码结果、目标设备所在的地理区域和当前时间所属的时间段。Step S112: Acquire a coding result sent by the data communication unit, a geographical area where the target device is located, and a time period to which the current time belongs.
具体的,数据处理单元具有定位功能,当数据处理单元在发送数据之前,对待传输数据进行编码时,会查找空调所在的地理区域和当前时间所属的时间段对应的子编码表(即下述的目标子编码表)进行编码,因此当服务器接收到编码结果后,还需要获取目标设备所在的地理区域和当前时间所属的时间段,才能够确定使用哪个子编码表对编码结果进行解码。Specifically, the data processing unit has a positioning function. When the data processing unit encodes the data to be transmitted before transmitting the data, it searches for a sub-coding table corresponding to the geographical area where the air conditioner is located and the time period to which the current time belongs (ie, the following The target sub-coding table is encoded. Therefore, when the server receives the encoding result, it also needs to obtain the geographical area where the target device is located and the time period to which the current time belongs, so that it can determine which sub-encoding table is used to decode the encoding result.
在一种可选的实施例中,编码结果由空调的数据通信单元发送,由服务器接收,当前时间可以为服务器接收编码结果的时间,空调所在的地理区域可以由空调的数据通信的单元发送。In an optional embodiment, the encoding result is sent by the data communication unit of the air conditioner and received by the server. The current time may be the time when the server receives the encoded result, and the geographical area where the air conditioner is located may be sent by the data communication unit of the air conditioner.
步骤S114,根据目标设备所在的地理区域和当前时间所属的时间段在第一编码表中查找对应的目标子编码表。Step S114: Search for a corresponding target sub-code table in the first coding table according to the geographical area where the target device is located and the time period to which the current time belongs.
具体的,第一编码表包括多个预设地理区域在多个预设时间段的子编码表,因此通过编码结果对应的空调所处的地理区域和当前时间段这两个维度,可以确定一个用于对编码结果进行解码的目标子编码表。Specifically, the first coding table includes a sub-coding table of a plurality of preset geographic regions in a plurality of preset time segments, so that one of the two regions of the geographical area and the current time period in which the air-conditioning corresponding to the coding result is located may determine one A target subcode table for decoding the encoded result.
图3是根据本申请其中一实施例的一种确定目标子编码表的示意图,在一种可选的实施例中,将地理区域为南方和北方两个地理区域,时间段包括春(3-5月)、夏(6至8月)、秋(9-11月)以及冬(12-2月)四个时间段,因此一个第一编码表中包括8个子编码表,8个子编码表分别为南方的空调在春夏秋冬四个时间段的子编码表1、2、3、4和北方的空调在春夏秋冬四个时间段的子编码表5、6、7、8。3 is a schematic diagram of a determination target sub-coding table according to an embodiment of the present application. In an optional embodiment, the geographical area is two geographical regions of the south and the north, and the time period includes spring (3- Four periods of May, June (June to August), Autumn (September-November), and Winter (December-February), so a first code table includes 8 sub-code tables, and 8 sub-code tables respectively. For the southern air conditioning in the spring, summer, autumn and winter four sub-codes 1, 2, 3, 4 and the northern air conditioning in the spring, summer, autumn and winter four sub-codes 5, 6, 7, 8 .
结合图3所示,对于位于东北的多联机1,在1月份时对应的子编码表为表4,因此服务器在接收到编码结果后,根据表4对编码结果进行解码;对于位于四川的多联机2,在8月份时对应的子编码表为表6,因此服务器在接收到编码结果后,根据表6对编码结果进行解码;对于位于深圳的多联机3,在4月份时对应的子编码表为表5,因此服务器在接收到编码结果后,根据表5对编码结果进行解码。As shown in FIG. 3, for the multi-connection 1 located in the northeast, the corresponding sub-encoding table in January is Table 4, so after receiving the encoding result, the server decodes the encoding result according to Table 4; Online 2, the corresponding sub-encoding table in August is Table 6, so after receiving the encoding result, the server decodes the encoding result according to Table 6; for the multi-connection 3 located in Shenzhen, the corresponding sub-encoding in April The table is Table 5, so after receiving the encoding result, the server decodes the encoding result according to Table 5.
在上述实施例中,第一编码表可以存储在数据库中,服务器从数据库中查找对应的目标子编码表进行解码。In the above embodiment, the first encoding table may be stored in a database, and the server searches for a corresponding target sub-coding table from the database for decoding.
步骤S116,根据目标子编码表对编码结果进行解码。Step S116, decoding the encoded result according to the target sub-coding table.
在一种可选的实施例中,第一编码表中的每个子编码表都为哈夫曼编码表,因此在确定目标子编码表后,可以采用哈夫曼编码的方式,通过目标子编码表对编码结果进行解码。In an optional embodiment, each sub-coding table in the first coding table is a Huffman coding table, so after determining the target sub-coding table, Huffman coding may be adopted by target sub-coding. The table decodes the encoded result.
可选的,根据本申请上述实施例,在根据预设地理区域的目标设备在预设时间段的子编码表构成第一编码表之后,上述方法还包括:Optionally, after the first coding table is configured by using the sub-coding table of the target device in the preset time zone according to the foregoing embodiment of the present application, the method further includes:
步骤S118,获取预设的周期,其中,周期包括多个预设的时间段。Step S118: Acquire a preset period, where the period includes a plurality of preset time periods.
具体的,由于气候以一年为一个周期进行变更,使得用户使用空调的习惯也根据气候进行变更,因此上述周期可以为一年。Specifically, since the climate is changed in a cycle of one year, the habit of using the air conditioner by the user is also changed according to the climate, so the above cycle may be one year.
步骤S120,当一个周期截止时,根据周期内的历史数据,对第一编码表进行优化处理。In step S120, when one cycle is cut off, the first coding table is optimized according to historical data in the cycle.
具体的,虽然每年在同一季节的气候相似,用户使用空调的习惯也相似,但随着地球气候的变化,每年都可能会有不同的变化趋势。因此上述步骤使用最近一个周期的历史数据对第一编码表进行优化。Specifically, although the climate in the same season is similar every year, the habits of users using air conditioners are similar, but as the climate of the earth changes, there may be different trends every year. Therefore, the above steps optimize the first coding table using the historical data of the most recent cycle.
在一种可选的实施例中,以2017年1月为一个周期的开端,到2018年1月,该周期截止。服务器则使用这一周期内获取的历史数据,对之前数据传输单元中的第一编码表进行优化。结合图3所示,服务器会周期性的优化第一编码表,用于保证用于编解码的第一编码表为最优编码表。In an alternative embodiment, January 2017 is the beginning of a cycle, and by January 2018, the cycle is closed. The server then uses the historical data acquired during this period to optimize the first coding table in the previous data transmission unit. As shown in FIG. 3, the server periodically optimizes the first coding table to ensure that the first coding table used for coding and decoding is the optimal coding table.
可选的,根据本申请上述实施例,当一个周期截止时,根据周期内的历史数据,对第一编码表进行优化处理,包括:Optionally, according to the foregoing embodiment of the present application, when a period is cut off, the first coding table is optimized according to historical data in the period, including:
步骤S121,根据周期内的历史数据中,每个字符出现的概率构建周期的第二编码表。Step S121, constructing a second coding table of the period according to the probability that each character appears in the historical data in the period.
具体的,上述第二编码表的构建方式与第一编码表相同,区别在于使用的历史数据是不同周期内的历史数据。Specifically, the second coding table is constructed in the same manner as the first coding table, except that the historical data used is historical data in different periods.
步骤S125,如果第二编码表的平均码长短于第一编码表的平均码长,则确定第二编码表为下一周期内的第一编码表,并将第二编码表发送至目标设备的数据传输单元。Step S125, if the average code length of the second coding table is shorter than the average code length of the first coding table, determine that the second coding table is the first coding table in the next cycle, and send the second coding table to the target device. Data transfer unit.
在上述步骤S125中,确定第二编码表为下一周期内的第一编码表,即为确定第二编码表为当前的最优编码表,在下一个周期,使用第二编码表对数据进行编解码。In the above step S125, determining that the second coding table is the first coding table in the next cycle, that is, determining that the second coding table is the current optimal coding table, and in the next cycle, using the second coding table to compile the data. decoding.
具体的,将第二编码表发送至目标设备的数据传输单元时,可以将第二编码表整个表发送至各个目标设备的数据传输单元,也可以根据目标设备所属的地理区域,将目标设备所属的地理区域在多个预设时间段的子编码表发送至数据传输单元。Specifically, when the second coding table is sent to the data transmission unit of the target device, the entire table of the second coding table may be sent to the data transmission unit of each target device, or the target device may be belonged according to the geographical area to which the target device belongs. The geographical area is sent to the data transmission unit in a sub-coding table of a plurality of preset time periods.
如果第二编码表的平均码长短于第一编码表的平均码长,则说明第二编码表优于第一编码表,即第二编码表为当前的最优编码表,因此确定第二编码表为下一周期内的第一编码表,如果第二码表的平均码长长于第一编码表的平均码长,则说明第一编码表优于第二编码表,第一编码表仍未最优编码表,因此下一个周期仍然时候第一编码表进行编解码。If the average code length of the second coding table is shorter than the average code length of the first coding table, it indicates that the second coding table is better than the first coding table, that is, the second coding table is the current optimal coding table, and thus the second coding is determined. The table is the first coding table in the next period. If the average code of the second code table is longer than the average code length of the first code table, the first coding table is better than the second coding table, and the first coding table is still not The optimal coding table, so the first coding table is still coded and decoded in the next cycle.
在上述方案中,服务器继续根据大数据分析出第二编码表,以对第一编码表进行优化,并在第二编码表优于第一编码表的情况下,将第二编码表发送至DTU,从而使得服务器和DTU端动态的维护这张表,并使这张表始终为最优编码表。In the above solution, the server continues to analyze the second coding table according to the big data to optimize the first coding table, and sends the second coding table to the DTU if the second coding table is better than the first coding table. So that the server and the DTU side dynamically maintain this table and make this table always the optimal coding table.
实施例2Example 2
根据本发明实施例,提供了一种设备的数据处理方法的实施例,图4是根据本申请其中一实施例的一种设备的数据处理方法,该实施例如下步骤的执行主体为DTU,结合图4所示,该方法包括:According to an embodiment of the present invention, an embodiment of a data processing method of a device is provided. FIG. 4 is a data processing method of a device according to an embodiment of the present application. As shown in Figure 4, the method includes:
步骤S41,获取第一编码表,其中,第一编码表包括预设地理区域的目标设备在预设时间段的子编码表,子编码表中字符对应的编码符号长度与字符在子编码表对应的历史数据中出现的概率呈反比例关系。Step S41, the first coding table is obtained, where the first coding table includes a sub-coding table of the target device of the preset geographic area in a preset time period, and the length of the coding symbol corresponding to the character in the sub-coding table corresponds to the character in the sub-coding table. The probability of occurrence in historical data is inversely proportional.
具体的,上述第一编码表可以由服务器根据历史数据构建的,并在DTU出厂之前写入,服务器构建第一编码表的方式可以是先构建每个预设地理区域的目标设备在每个预设时间其余的子编码表,再将多个子编码表合并为一张总表。服务器构建子编码表的方式可以如实施例1所示。Specifically, the foregoing first coding table may be constructed by the server according to the historical data, and is written before the DTU leaves the factory. The manner in which the server constructs the first coding table may be to first construct a target device of each preset geographic area in each pre-preparation. Set the rest of the sub-code table, and then combine the multiple sub-code tables into a single table. The manner in which the server constructs the subcode table can be as shown in Embodiment 1.
在上述步骤S41中,每个子编码表具有对应的地理区域和对应的时间段,子编码表对应的历史数据为用于构建该子编码表的历史数据,即子编码表对应的预设地理区域的目标设备在对应的预设时间段内的历史数据。In the above step S41, each sub-code table has a corresponding geographical area and a corresponding time period, and the historical data corresponding to the sub-code table is historical data for constructing the sub-code table, that is, a preset geographical area corresponding to the sub-code table. The historical data of the target device within the corresponding preset time period.
步骤S43,根据第一编码表对待传输数据进行编码。Step S43, encoding the data to be transmitted according to the first coding table.
具体的,上述待传输数据为DTU获取的空调中各个传感器检测的数据,以及其他需要向服务器传输的数据。DTU向服务器传输数据的时机可以是在DTU中设定的传输周期,用于服务器对空调的运行进行远程监控,还可以是当空调产生故障时,为了使服务器能够进行故障分析而传输的数据。Specifically, the data to be transmitted is the data detected by each sensor in the air conditioner acquired by the DTU, and other data that needs to be transmitted to the server. The timing at which the DTU transmits data to the server may be a transmission period set in the DTU for remote monitoring of the operation of the air conditioner by the server, or data transmitted in order to enable the server to perform failure analysis when the air conditioner generates a failure.
由上可知,本申请上述实施例获取第一编码表,其中,第一编码表包括预设地理区域的目标设备在预设时间段的子编码表,子编码表中字符对应的编码符号长度与字符在子编码表对应的历史数据中出现的概率呈反比例关系,根据第一编码表对待传输数据进行编码。在上述方案中,服务器和DTU中都维护着一张第一编码表,DTU使用该第一编码表对数据进行编码,从而能够减少数据量,解决了现有技术中家电通过DTU传输数据时传输费用较高的技术问题。As can be seen from the above, the foregoing embodiment obtains the first coding table, where the first coding table includes a sub-coding table of the target device of the preset geographic area in a preset time period, and the length of the coding symbol corresponding to the character in the sub-coding table is The probability that the character appears in the historical data corresponding to the sub-code table is inversely proportional, and the data to be transmitted is encoded according to the first coding table. In the above solution, both the server and the DTU maintain a first coding table, and the DTU uses the first coding table to encode the data, thereby reducing the amount of data and solving the transmission of the home appliance when transmitting data through the DTU in the prior art. Higher technical issues.
可选的,根据本申请上述实施例,根据第一编码表对待传输数据进行编码,包括:Optionally, according to the foregoing embodiment of the present application, the data to be transmitted is encoded according to the first coding table, including:
步骤S431,获取目标设备所在位置对应的地理区域和当前时间所属的时间段。Step S431: Obtain a geographic area corresponding to the location where the target device is located and a time period to which the current time belongs.
步骤S433,根据地理区域和时间段,从第一编码表中查找对应的目标子编码表。Step S433, searching for a corresponding target sub-code table from the first coding table according to the geographical area and the time period.
步骤S435,根据目标子编码表对待传输数据编码。Step S435, encoding the data to be transmitted according to the target sub-coding table.
图3是根据本申请是实施例的一种确定目标子编码表的示意图,在一种可选的实施例中,将地理区域为南方和北方两个地理区域,时间段包括春(3-5月)、夏(6至8月)、秋(9-11月)以及冬(12-2月)四个时间段,因此一个第一编码表中包括8个子编码表,8个子编码表分别为南方的空调在春夏秋冬四个时间段的子编码表1、2、3、4和北方的空调在春夏秋冬四个时间段的子编码表5、6、7、8。FIG. 3 is a schematic diagram of a determination target sub-coding table according to an embodiment of the present application. In an optional embodiment, the geographical area is two geographical regions of the south and the north, and the time period includes spring (3-5). Month), summer (June to August), autumn (September-November), and winter (December-February) four time periods, so a first coding table includes 8 sub-code tables, and 8 sub-code tables are respectively Sub-codes 1, 2, 3, 4 of the air conditioning in the four seasons of spring, summer, autumn and winter and sub-codes 5, 6, 7, and 8 of the four periods of spring, summer, autumn and winter.
结合图3所示,对于位于东北的多联机1,在1月份时对应的子编码表为表4,因此采用表4对多联机1的DTU的数据进行编码,传输至服务器;对于位于四川的多联机2,在8月份时对应的子编码表为表6,因此采用表6对多联机1的DTU的数据进行编码,传输至服务器;对于位于深圳的多联机3,在4月份时对应的子编码表为表5,因此采用表5对多联机1的DTU的数据进行编码,传输至服务器。As shown in FIG. 3, for the multi-connection 1 located in the northeast, the corresponding sub-code table in January is Table 4, so the data of the DTU of the multi-line 1 is encoded and transmitted to the server using Table 4; Multi-line 2, the corresponding sub-code table in August is Table 6, so the data of the DTU of the multi-line 1 is encoded and transmitted to the server using Table 6; for the multi-line 3 located in Shenzhen, corresponding in April The sub-encoding table is shown in Table 5, so the data of the DTU of the multi-line 1 is encoded using Table 5 and transmitted to the server.
可选的,根据本申请上述实施例,在根据第一编码表对待传输数据进行编码之前,上述方法还包括:Optionally, according to the foregoing embodiment of the present application, before the encoding the data to be transmitted according to the first encoding table, the method further includes:
步骤S45,检测是否接收到服务器发送的用于更新第一编码表的第二编码表。Step S45, detecting whether a second encoding table sent by the server for updating the first encoding table is received.
在上述步骤S45中,可以结合步骤S125所示,如果第二编码表的平均码长短于第一编码表的平均码长,则服务器确定第二编码表为下一周期内的第一编码表,并将第二编码表发送至目标设备的数据传输单元。也即,如果第二编码表的平均码长短于第一编码表的平均码长,则DTU接收到服务器传输的第二编码表。In the foregoing step S45, if the average code length of the second coding table is shorter than the average code length of the first coding table, the server determines that the second coding table is the first coding table in the next cycle, as shown in step S125. And transmitting the second code table to the data transmission unit of the target device. That is, if the average code length of the second coding table is shorter than the average code length of the first coding table, the DTU receives the second coding table transmitted by the server.
步骤S47,如果接收到第二编码表,则使用第二编码表替换第一编码表。Step S47, if the second encoding table is received, the first encoding table is replaced with the second encoding table.
如果服务器向DTU发送第二编码表,则确定第二编码表优于第一编码表,在这种情况下,DTU使用第二编码表替换第一编码表,从而使得DTU中能够始终维护有最优编码表,并能够始终使用最优编码表进行编码。If the server sends the second coding table to the DTU, it is determined that the second coding table is better than the first coding table, in which case the DTU replaces the first coding table with the second coding table, so that the DTU can always maintain the most Excellent coding table and can always be encoded using the optimal coding table.
此处需要说明的是,在上述步骤S47中,DTU使用第二编码表替换第一编码表时,可以是将第二编码表的整表对第一编码表进行替换,还可以是仅将第二编码表中,空调所在的地理区域的子编码表对第一编码表中目标设备所在地理区域的子编码表进行替换。It should be noted that, in the foregoing step S47, when the DTU replaces the first coding table by using the second coding table, the entire table of the second coding table may be replaced with the first coding table, or In the second coding table, the sub-coding table of the geographical area where the air conditioner is located replaces the sub-coding table of the geographical area where the target device is located in the first coding table.
在一种可选的实施例中,空调所属的地理区域为华东区域,因此在进行第一编码表的优化时,可以将第二编码表中,华东区域在春夏秋冬四个季节的四个子编码表,对第一编码表中华东区域在春夏秋冬四个季节的四个子编码表进行替换。In an optional embodiment, the geographical area to which the air conditioner belongs is the East China region. Therefore, when the first coding table is optimized, the second coding table may be used, and the East China region has four children in the four seasons of spring, summer, autumn and winter. The coding table replaces the four sub-code tables of the East China region in the first coding table in the four seasons of spring, summer, autumn and winter.
图5是根据本申请其中一实施例的一种DTU对待传输数据进行编码的示意图,结合图5所示,在一种可选的实施例中,DTU对待传输数据进行编码可以包括如下几个步骤:FIG. 5 is a schematic diagram of encoding a DTU to be transmitted according to an embodiment of the present application. As shown in FIG. 5, in an optional embodiment, encoding a DTU to transmit data may include the following steps. :
S51,获取时间。S51, obtaining time.
具体的,上述时间为DTU即将对数据进行编码的时间。Specifically, the above time is the time when the DTU is about to encode the data.
S52,获取地址。S52, obtaining an address.
具体的,上述地址为空调在地址。Specifically, the above address is the address of the air conditioner.
S53,DTU数据采集。S53, DTU data acquisition.
具体的,DTU采集的数据可以是空调的传感器检测的数据。Specifically, the data collected by the DTU may be data detected by the sensor of the air conditioner.
S54,查找编码表。S54, look up the coding table.
在空调刚出厂时,会向DTU预存生成的第一编码表,在使用过程中,服务器还可能根据新生成的第二编码表对第一编码表进行更新,因此上述步骤查找到的编码表为最近一次更新的编码表。When the air conditioner is just shipped from the factory, the first code table generated by the DTU is pre-stored. During use, the server may also update the first code table according to the newly generated second code table, so the code table found in the above step is The most recently updated codelist.
S55,判断当前编码表是否为最优编码表,在判断结果为是的情况下,进入步骤S56,否则进入继续执行步骤S55。S55. Determine whether the current coding table is an optimal coding table. If the determination result is yes, the process proceeds to step S56, otherwise, the process proceeds to step S55.
在上述步骤S55中,如果服务器对DTU中的编码表进行了更新,则查找到的原编码表不为最优编码表,需要从新查找,如果服务器没有对DTU终端编码表进行更新,则查找到的编码表即为最优编码表,可以进入步骤S56。In the above step S55, if the server updates the coding table in the DTU, the original coding table found is not the optimal coding table, and needs to be searched again. If the server does not update the DTU terminal coding table, it finds The coding table is the optimal coding table, and the process proceeds to step S56.
S56,使用查找的编码进行数据编码。S56, using the searched code for data encoding.
具体的,编码表可以为哈夫曼编码,编码方式也可以使用哈夫曼编码。Specifically, the coding table may be Huffman coding, and the coding mode may also use Huffman coding.
S57,传输编码结果。S57, transmitting the encoded result.
在上述步骤中,DTU将编码结果传输至服务器。In the above steps, the DTU transmits the encoded result to the server.
需要说明的是,在上述实施例中,各地的空调的DTU都将数据至传输至服务器,服务器除了根据数据对每个空调进行监控和故障诊断,还可以对海量数据进行新一轮的统计分析,该统计分析包括空间分析(生成数据的空调所属的地理区域)、时间分析(生成数据的时间)和协议分析(生成数据所使用的协议),综合集中分析结果来生成新的哈夫曼编码表(即第二编码表),并在预定的优化周期达到时,判断是否使用新生成的编码表替换DTU中的原编码表(即第一编码表),判断的原则是,新生成的编码表的平均码长是否短于原编码表的平均码长。It should be noted that, in the above embodiment, the DTUs of the air conditioners of various places transmit data to the server, and the server can perform a new round of statistical analysis on the massive data in addition to monitoring and fault diagnosis of each air conditioner according to the data. The statistical analysis includes spatial analysis (the geographical area to which the air conditioner generating the data belongs), time analysis (time of generating the data), and protocol analysis (the protocol used to generate the data), and comprehensively analyzing the results to generate a new Huffman code. a table (ie, a second coding table), and when the predetermined optimization period is reached, determining whether to replace the original coding table (ie, the first coding table) in the DTU with the newly generated coding table, the principle of the judgment is that the newly generated coding Whether the average code length of the table is shorter than the average code length of the original code table.
实施例3Example 3
根据本发明实施例,提供了一种设备的数据处理装置的实施例,图6是根据本申请其中一实施例的一种设备的数据处理装置的示意图,结合图6所示,该装置包括:An embodiment of a data processing apparatus of an apparatus according to an embodiment of the present invention is provided. FIG. 6 is a schematic diagram of a data processing apparatus of a device according to an embodiment of the present application. As shown in FIG. 6, the apparatus includes:
第一获取模块60,设置为获取目标设备在预设时间段内的历史数据,其中,目标设备处于预设地理区域内。The first obtaining module 60 is configured to acquire historical data of the target device within a preset time period, where the target device is in the preset geographic area.
分析模块62,设置为对历史数据进行分析,确定历史数据中每种字符出现的概率。The analysis module 62 is configured to analyze the historical data to determine the probability of occurrence of each character in the historical data.
生成模块64,设置为根据每种字符出现的概率,生成用于对预设地理区域的目标设备在预设时间段的待传输数据进行编码的子编码表,其中,每种字符在历史数据中出现的概率与字符在子编码表中对应的编码符号长度呈反比例关系。The generating module 64 is configured to generate, according to the probability of occurrence of each character, a sub-coding table for encoding the data to be transmitted of the target device of the preset geographical area in a preset time period, wherein each character is in the historical data. The probability of occurrence is inversely proportional to the length of the corresponding coded symbol in the subcode table.
实施例4Example 4
根据本发明实施例,提供了一种设备的数据处理装置的实施例,图7是根据本申请其中一实施例的一种设备的数据处理装置的示意图,结合图7所示,该装置包括:An embodiment of a data processing apparatus of an apparatus according to an embodiment of the present invention is provided. FIG. 7 is a schematic diagram of a data processing apparatus of a device according to an embodiment of the present application. As shown in FIG. 7, the apparatus includes:
第二获取模块70,设置为获取第一编码表,其中,第一编码表包括预设地理区域的目标设备在预设时间段的子编码表,子编码表中字符对应的编码符号长度与字符在子编码表对应的历史数据中出现的概率呈反比例关系。The second obtaining module 70 is configured to obtain a first encoding table, where the first encoding table includes a sub-coding table of the target device of the preset geographic area in a preset time period, and the length and character of the encoding symbol corresponding to the characters in the sub-coding table The probability of occurrence in the historical data corresponding to the sub-code table is inversely proportional.
编码模块72,设置为根据第一编码表对待传输数据进行编码。The encoding module 72 is configured to encode the data to be transmitted according to the first encoding table.
实施例5Example 5
根据本发明实施例,提供了一种存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行实施例1的设备的数据处理方法,或实施例2的设备的数据处理方法。According to an embodiment of the present invention, a storage medium is provided, where the storage medium includes a stored program, wherein, when the program is running, the data processing method of the device in which the storage medium is executed is executed, or the data of the device in Embodiment 2 is controlled. Approach.
实施例6Example 6
根据本发明实施例,提供了一种处理器,处理器用于运行程序,其中,程序运行时执行实施例1的设备的数据处理方法,或实施例2的设备的数据处理方法。According to an embodiment of the present invention, there is provided a processor for executing a program, wherein the data processing method of the device of Embodiment 1 or the data processing method of the device of Embodiment 2 is executed when the program is running.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present invention, the descriptions of the various embodiments are different, and the parts that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件 可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed technical contents may be implemented in other manners. The device embodiments described above are only schematic. For example, the division of the unit may be a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above description is only a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It should be considered as the scope of protection of the present invention.
工业实用性Industrial applicability
如上所述,本申请至少部分实施例提供的设备的数据处理方法和装置具有以下有益效果:通过历史数据确定每个地理区域的目标设备在不同时间段的数据中每种字符出现的概率,从而获取到不同地理区域的目标设备在不同时间段内出现的数据规律,进而根据这一规律为字符确定对应的编码符号,达到了降低数据量的目的,在DTU数据传输费用一定的情况下,降低了DTU数据传输费用,解决了现有技术中家电通过DTU传输数据时传输费用较高的技术问题。As described above, the data processing method and apparatus of the apparatus provided by at least some embodiments of the present application have the following beneficial effects: determining, by historical data, a probability that each target character of each geographical area appears in data of different time periods, thereby Obtaining the data law of the target devices in different geographical regions in different time periods, and then determining the corresponding coding symbols for the characters according to the law, thereby achieving the purpose of reducing the amount of data, and reducing the DTU data transmission cost. The DTU data transmission cost solves the technical problem of high transmission cost when the home appliance transmits data through the DTU in the prior art.

Claims (12)

  1. 一种设备的数据处理方法,包括:A data processing method for a device, comprising:
    获取目标设备在预设时间段内的历史数据,其中,所述目标设备处于预设地理区域内;Obtaining historical data of the target device in a preset time period, wherein the target device is in a preset geographic area;
    对所述历史数据进行分析,确定所述历史数据中每种字符出现的概率;Performing analysis on the historical data to determine a probability of occurrence of each character in the historical data;
    根据所述每种字符出现的概率,生成用于对所述预设地理区域的目标设备在所述预设时间段的待传输数据进行编码的子编码表,其中,所述每种字符在所述历史数据中出现的概率与所述字符在所述子编码表中对应的编码符号长度呈反比例关系。Generating, according to the probability of occurrence of each character, a sub-coding table for encoding the data to be transmitted of the target device of the preset geographic area in the preset time period, where each of the characters is in the The probability of occurrence in the historical data is inversely proportional to the length of the corresponding coded symbol in the sub-code table.
  2. 根据权利要求1所述的方法,其中,所述预设地理区域为多个,所述预设时间段为多个,在根据所述每种字符出现的概率,生成用于对所述预设地理区域的目标设备在所述预设时间段的待传输数据进行编码的子编码表之后,所述方法还包括:The method according to claim 1, wherein the preset geographical area is plural, and the preset time period is plural, and is generated for the preset according to a probability of occurrence of each character. After the target device of the geographic area is encoded by the sub-coded table of the data to be transmitted in the preset time period, the method further includes:
    根据多个所述预设地理区域的目标设备在多个所述预设时间段的多个子编码表构成第一编码表;Determining, by the target device of the plurality of the preset geographic regions, a first coding table in a plurality of sub-coding tables of the plurality of preset time segments;
    将所述第一编码表写入所述目标设备的数据通信单元,其中,所述目标设备的数据通信单元使用所述第一编码表对所述待传输数据编码,得到编码结果。Writing the first code table to the data communication unit of the target device, wherein the data communication unit of the target device encodes the data to be transmitted using the first coding table to obtain a coding result.
  3. 根据权利要求2所述的方法,其中,在将所述第一编码表写入所述目标设备的数据通信单元之后,所述方法还包括:The method of claim 2, wherein after the first encoding table is written to the data communication unit of the target device, the method further comprises:
    获取所述数据通信单元发送的所述编码结果、所述目标设备所在的地理区域和当前时间所属的时间段;Obtaining, by the data communication unit, the coding result, a geographical area where the target device is located, and a time period to which the current time belongs;
    根据所述目标设备所在的地理区域和所述当前时间所属的时间段在所述第一编码表中查找对应的目标子编码表;Searching, in the first coding table, a corresponding target sub-code table according to a geographical area where the target device is located and a time period to which the current time belongs;
    根据所述目标子编码表对所述编码结果进行解码。The encoded result is decoded according to the target sub-coding table.
  4. 根据权利要求2所述的方法,其中,在根据多个所述预设地理区域的目标设备在多个所述预设时间段的多个子编码表构成第一编码表之后,所述方法还包括:The method according to claim 2, wherein after the first coding table is formed by the plurality of sub-code tables of the plurality of the predetermined time periods according to the target device of the plurality of the predetermined geographical areas, the method further comprises :
    获取预设的周期,其中,所述周期包括多个预设时间段;Obtaining a preset period, wherein the period includes a plurality of preset time periods;
    当一个所述周期截止时,根据所述周期内的历史数据,对所述第一编码表进行优化处理。When one of the periods is cut off, the first coding table is optimized according to historical data in the period.
  5. 根据权利要求4所述的方法,其中,当一个所述周期截止时,根据所述周期内的历史数据,对所述第一编码表进行优化处理,包括:The method according to claim 4, wherein, when one of the periods is cut off, the first encoding table is optimized according to historical data in the period, including:
    根据所述周期内的历史数据中每个字符出现的概率,构建所述周期的第二编码表;Constructing a second coding table of the period according to a probability of occurrence of each character in the historical data in the period;
    获取所述第二编码表的平均码长和所述第一编码表的平均码长;Obtaining an average code length of the second coding table and an average code length of the first coding table;
    如果所述第二编码表的平均码长短于所述第一编码表的平均码长,则确定所述第二编码表为下一周期内的第一编码表,并将所述第二编码表发送至所述目标设备的数据传输单元。If the average code length of the second coding table is shorter than the average code length of the first coding table, determining that the second coding table is the first coding table in the next cycle, and the second coding table A data transmission unit that is sent to the target device.
  6. 一种设备的数据处理方法,包括:A data processing method for a device, comprising:
    获取第一编码表,其中,所述第一编码表包括预设地理区域的目标设备在预设时间段的子编码表,所述子编码表中字符对应的编码符号长度与所述字符在所述子编码表对应的历史数据中出现的概率呈反比例关系;Obtaining a first coding table, where the first coding table includes a sub-coding table of a target device of a preset geographic area in a preset time period, and a length of the coded symbol corresponding to the character in the sub-coding table and the character is in the The probability of occurrence in the historical data corresponding to the sub-coding table is inversely proportional;
    根据所述第一编码表对待传输数据进行编码。The data to be transmitted is encoded according to the first coding table.
  7. 根据权利要求6所述的方法,其中,根据所述第一编码表对待传输数据进行编码,包括:The method of claim 6, wherein encoding the data to be transmitted according to the first encoding table comprises:
    获取所述目标设备所在位置对应的地理区域和当前时间所属的时间段;Obtaining a geographic area corresponding to the location where the target device is located and a time period to which the current time belongs;
    根据所述地理区域和所述时间段,从所述第一编码表中查找对应的目标子编码表;Searching, according to the geographic area and the time period, a corresponding target sub-code table from the first coding table;
    根据所述目标子编码表对所述待传输数据编码。And encoding the data to be transmitted according to the target sub-coding table.
  8. 根据权利要求6所述的方法,其中,在根据所述第一编码表对待传输数据进行编码之前,所述方法还包括:The method according to claim 6, wherein before the encoding of the data to be transmitted according to the first encoding table, the method further comprises:
    检测是否接收到服务器发送的用于更新所述第一编码表的第二编码表;Detecting whether a second code table sent by the server for updating the first code table is received;
    如果接收到所述第二编码表,则使用所述第二编码表替换所述第一编码表。If the second encoding table is received, the first encoding table is replaced with the second encoding table.
  9. 一种设备的数据处理装置,包括:A data processing device for a device, comprising:
    第一获取模块,设置为获取目标设备在预设时间段内的历史数据,其中,所述目标设备处于预设地理区域内;a first acquiring module, configured to acquire historical data of the target device in a preset time period, where the target device is in a preset geographic area;
    分析模块,设置为对所述历史数据进行分析,确定所述历史数据中每种字符出现的概率;An analysis module configured to analyze the historical data to determine a probability of occurrence of each character in the historical data;
    生成模块,设置为根据所述每种字符出现的概率,生成用于对所述预设地理区域的目标设备在所述预设时间段的待传输数据进行编码的子编码表,其中,所 述每种字符在所述历史数据中出现的概率与所述字符在所述子编码表中对应的编码符号长度呈反比例关系。a generating module, configured to generate, according to a probability of occurrence of each character, a sub-coding table for encoding, by the target device of the preset geographic area, the data to be transmitted in the preset time period, where The probability that each character appears in the historical data is inversely proportional to the length of the corresponding encoded symbol in the sub-code table.
  10. 一种设备的数据处理装置,包括:A data processing device for a device, comprising:
    第二获取模块,设置为获取第一编码表,其中,所述第一编码表包括预设地理区域的目标设备在预设时间段的子编码表,所述子编码表中字符对应的编码符号长度与所述字符在所述子编码表对应的历史数据中出现的概率呈反比例关系;a second obtaining module, configured to obtain a first encoding table, where the first encoding table includes a sub-encoding table of a target device of a preset geographic area in a preset time period, and an encoding symbol corresponding to the character in the sub-encoding table The length is inversely proportional to the probability that the character appears in the historical data corresponding to the sub-coding table;
    编码模块,设置为根据所述第一编码表对待传输数据进行编码。And an encoding module configured to encode the data to be transmitted according to the first encoding table.
  11. 一种存储介质,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在目标设备执行权利要求1至5中任意一项所述的设备的数据处理方法,或权利要求6至8中任意一项所述的设备的数据处理方法。A storage medium, comprising: a stored program, wherein, when the program is running, controlling a target device in which the storage medium is located to perform a data processing method of the device according to any one of claims 1 to 5, or A data processing method of the device according to any one of claims 6 to 8.
  12. 一种处理器,所述处理器设置为运行程序,其中,所述程序运行时执行权利要求1至5中任意一项所述的设备的数据处理方法,或权利要求6至8中任意一项所述的设备的数据处理方法。A processor, the processor being configured to execute a program, wherein the program is executed to execute a data processing method of the device according to any one of claims 1 to 5, or any one of claims 6 to 8. The data processing method of the device.
PCT/CN2018/121258 2018-04-09 2018-12-14 Data processing method and apparatus for device WO2019196480A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810312442.8A CN108599897B (en) 2018-04-09 2018-04-09 Data processing method and device of equipment
CN201810312442.8 2018-04-09

Publications (1)

Publication Number Publication Date
WO2019196480A1 true WO2019196480A1 (en) 2019-10-17

Family

ID=63621225

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/121258 WO2019196480A1 (en) 2018-04-09 2018-12-14 Data processing method and apparatus for device

Country Status (2)

Country Link
CN (1) CN108599897B (en)
WO (1) WO2019196480A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108599897B (en) * 2018-04-09 2020-08-11 珠海格力电器股份有限公司 Data processing method and device of equipment
CN110996440A (en) * 2019-11-29 2020-04-10 青岛海尔科技有限公司 Control method and device for household appliance control panel and control panel
CN114979707B (en) * 2022-05-13 2023-12-19 深圳智慧林网络科技有限公司 Data transmission method and device
CN114979094A (en) * 2022-05-13 2022-08-30 深圳智慧林网络科技有限公司 Data transmission method, device, equipment and medium based on RTP
CN114979794B (en) * 2022-05-13 2023-11-14 深圳智慧林网络科技有限公司 Data transmission method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4103287A (en) * 1973-12-17 1978-07-25 Bell Telephone Laboratories, Incorporated Variable length codes for high quality image encoding
CN1144583A (en) * 1994-04-01 1997-03-05 多尔拜实验特许公司 Compact source coding tables for encoder/decoder system
CN105258303A (en) * 2015-11-20 2016-01-20 珠海格力电器股份有限公司 Remote transmission control method and device for air conditioner unit operation data and air conditioner
CN105704028A (en) * 2016-03-25 2016-06-22 北京华为数字技术有限公司 Message processing method and message processing device
CN108599897A (en) * 2018-04-09 2018-09-28 珠海格力电器股份有限公司 The data processing method and device of equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101325418B (en) * 2008-08-05 2012-11-21 北京海尔集成电路设计有限公司 Haffman quick decoding method based on probability table look-up
CN102164019B (en) * 2010-12-31 2013-04-17 华为技术有限公司 Channel state information compression method and device
CN102438145A (en) * 2011-11-22 2012-05-02 广州中大电讯科技有限公司 Image lossless compression method on basis of Huffman code
CN104283568B (en) * 2013-07-12 2017-05-17 中国科学院声学研究所 Data compressed encoding method based on part Hoffman tree
CN104394097B (en) * 2014-12-11 2017-10-31 广州广电运通金融电子股份有限公司 Self-aided terminal monitoring method and system
CN106547470B (en) * 2015-09-16 2020-01-03 伊姆西公司 Log storage optimization method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4103287A (en) * 1973-12-17 1978-07-25 Bell Telephone Laboratories, Incorporated Variable length codes for high quality image encoding
CN1144583A (en) * 1994-04-01 1997-03-05 多尔拜实验特许公司 Compact source coding tables for encoder/decoder system
CN105258303A (en) * 2015-11-20 2016-01-20 珠海格力电器股份有限公司 Remote transmission control method and device for air conditioner unit operation data and air conditioner
CN105704028A (en) * 2016-03-25 2016-06-22 北京华为数字技术有限公司 Message processing method and message processing device
CN108599897A (en) * 2018-04-09 2018-09-28 珠海格力电器股份有限公司 The data processing method and device of equipment

Also Published As

Publication number Publication date
CN108599897B (en) 2020-08-11
CN108599897A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
WO2019196480A1 (en) Data processing method and apparatus for device
CN103379136A (en) Compression method and decompression method of log acquisition data, compression apparatus and decompression apparatus of log acquisition data
CN102469493B (en) Method and device for estimating hollow states of wireless local area network
CN104572885B (en) A kind of user function preference data collects and surveys method and system
CN103379140A (en) Log processing rule synchronization method and relative device and system
WO2020024506A1 (en) Air conditioner control method and device, storage medium, and processor
CN116558082B (en) Energy-saving ventilation system
CN106921507A (en) The method and apparatus being predicted to customer complaint within a wireless communication network
CN106415619A (en) Optimizing the distribution of electrical energy
CN111435039A (en) Water temperature control method and device, water heater and storage medium
JPWO2010131638A1 (en) Home appliance management system
CN107516409A (en) Power information acquisition system electric energy meter cognitive method based on narrow-band power line carrier
CN104811394A (en) Method and system for saving traffic for accessing server
Chen et al. Online time interval top-k queries in wireless sensor networks
CN109511111A (en) A kind of method of energy acquisition Internet of things system data security transmission
CN105577455A (en) Method and system for performing real-time UV statistic of massive logs
CN110572783B (en) Remote safety monitoring management system and method based on short message
CN109346080B (en) Voice control method, device, equipment and storage medium
CN109617738B (en) Method, system and non-volatile storage medium for user service scaling
CN111786835A (en) Fault repairing method based on wireless Internet of things and related device
CN111953072A (en) Low-voltage distribution area topology identification method, device, equipment and storage medium
CN106909082A (en) It is a kind of new based on internet of things intelligent household control system
CN116669186A (en) Adaptive power distribution method based on Markov decision process
CN107689883B (en) Method and device for determining cooperative node
KR101653720B1 (en) Home Appliance Identification Method based on Real Time Power Consumption Analysis

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18914483

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18914483

Country of ref document: EP

Kind code of ref document: A1