CN115529357B - Updating abnormity matching method based on MES intercommunication interconnection production data - Google Patents
Updating abnormity matching method based on MES intercommunication interconnection production data Download PDFInfo
- Publication number
- CN115529357B CN115529357B CN202211482181.7A CN202211482181A CN115529357B CN 115529357 B CN115529357 B CN 115529357B CN 202211482181 A CN202211482181 A CN 202211482181A CN 115529357 B CN115529357 B CN 115529357B
- Authority
- CN
- China
- Prior art keywords
- chain code
- production data
- dimensional matrix
- optimal
- coding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/04—Protocols for data compression, e.g. ROHC
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/151—Transformation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/70—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Artificial Intelligence (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computer Security & Cryptography (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The invention relates to the technical field of data compression and transmission, in particular to an update exception matching method based on MES intercommunication interconnected production data, which comprises the following steps: encoding the production data into a one-dimensional binary sequence and converting the one-dimensional binary sequence into a two-dimensional matrix, and acquiring a foreground and a background according to the number of the digits in the two-dimensional matrix to further obtain an eight-connected domain of the foreground; dividing all direction symbols of the eight-direction chain code into a plurality of categories; taking each pixel point in each eight-connected domain as a chain code wharf, and performing chain code coding on each eight-connected domain to obtain the optimal coding of each pixel point; and acquiring the optimal degree of each pixel point as a chain code wharf according to the optimal code of each pixel point and the category to which each direction symbol in the optimal code belongs, and acquiring a compression result according to the optimal degree. The invention has small data volume of compressed data and high compression efficiency, and ensures that the transmission speed of the data is high.
Description
Technical Field
The invention relates to the technical field of data compression and transmission, in particular to an update exception matching method based on MES intercommunication interconnected production data.
Background
The MES system is a production informatization management system facing a workshop execution layer of a manufacturing enterprise, and the MES needs to perform information interaction with a planning layer and a control layer, so that the enterprise information full integration is realized through continuous information flow of the enterprise. The MES system generates a large amount of production data all the time in the process of communicating and interconnecting with the planning layer and the control layer, and when the production data are transmitted and stored, the production data are generally required to be compressed for better and faster transmission and storage of more production data, and the update exception matching of the production data can be completed by analyzing a compressed packet.
There is usually redundancy in the data, so the degree of redundancy of the data determines the compression rate of the data. All data are compressed in the traditional compression, but the data containing information in the data is usually only a part, and meanwhile, in order to facilitate data management and decompression, the variable length coding is usually required to be converted into the fixed length coding, and a large amount of data needs to be compensated in the conversion processHowever, when data compression is performed, all data is processed, which wastes a large amount of storage space.
Aiming at the situation, the invention provides an updating abnormity matching method based on MES intercommunication interconnected production data, which constructs a visual effect diagram by performing coding conversion on data to be compressed and stored, and performs data conversion in a self-adaptive manner through the distribution of the data in the visual effect diagram so as to simplify the data and achieve the purpose of increasing the compression ratio on the lossless basis.
Disclosure of Invention
The invention provides an updating exception matching method based on MES intercommunication interconnection production data, which aims to solve the existing problems.
The method for updating the exception matching based on the MES intercommunication interconnected production data adopts the following technical scheme:
one embodiment of the invention provides an updating exception matching method based on MES intercommunication interconnected production data, which comprises the following steps:
collecting production data, and encoding the production data into a one-dimensional binary sequence; converting the one-dimensional binary sequence into a two-dimensional matrix; converting the two-dimensional matrix into a visual effect graph;
acquiring a foreground and a background in the visual effect image according to the number of the numbers 0 and the number of the numbers 1 in the two-dimensional matrix; acquiring eight connected domains of the foreground in the visual effect image;
classifying all direction symbols of the eight-direction chain codes to obtain a plurality of classes;
taking each pixel point in each eight-connected domain as a chain code wharf, and performing chain code coding on each eight-connected domain to obtain the optimal coding of each pixel point; acquiring the optimal degree of each pixel point as a chain code wharf according to the optimal code of each pixel point and the category of each direction symbol in the optimal code;
and taking all pixel points in the eight connected domains as pixel points corresponding to the maximum optimization degree in the optimization degrees of the chain code wharf as a final chain code wharf, and converting the optimal code corresponding to the final chain code wharf into a binary system as a compression result.
Preferably, the collecting production data and encoding the production data into a one-dimensional binary sequence includes the following specific steps:
and carrying out fixed-length binary coding on the production data, and splicing all binary codes together to form a one-dimensional binary sequence.
Preferably, the converting the one-dimensional binary sequence into the two-dimensional matrix includes the following specific steps:
squaring the length of the one-dimensional binary sequence, and rounding the obtained result upwards to obtain the length of the side lengthConstruction ofAnd (3) filling binary digits in the one-dimensional binary sequence into the two-dimensional matrix according to the sequence of the two-dimensional matrix, and performing 0 complementing operation on vacant positions of the two-dimensional matrix.
Preferably, the converting the two-dimensional matrix into the visual effect map includes the following specific steps:
and expressing the number 0 in the two-dimensional matrix by using a white pixel point, and expressing the number 1 in the two-dimensional matrix by using a black pixel point to obtain a visual effect graph.
Preferably, the obtaining of the foreground and the background in the visual effect map according to the number of the number 0 and the number of the number 1 in the two-dimensional matrix includes the following specific steps:
if the number of the numbers 0 in the two-dimensional matrix is larger than the number of the numbers 1, taking black pixel points in the visual effect image as a foreground and white pixel points as a background; if the number of the numbers 0 in the two-dimensional matrix is smaller than the number of the numbers 1, taking white pixel points in the visual effect image as a foreground and black pixel points as a background; and if the number of the numbers 0 in the two-dimensional matrix is the same as that of the numbers 1, randomly selecting the foreground and the background.
Preferably, the classifying all direction symbols of the eight-direction chain code to obtain a plurality of categories includes the following specific steps:
all direction symbols of the eight-direction chain code comprise 0,1, 2, 3, 4, 5, 6 and 7, wherein 0 and 1 are divided into a first category, 2 and 3 are divided into a second category, and 4, 5, 6 and 7 are divided into a third category.
Preferably, the method for performing chain code coding on each eight-connected domain by using each pixel point in each eight-connected domain as a chain code dock to obtain the optimal coding of each pixel point comprises the following specific steps:
and taking one pixel point in the eight connected domains as a chain code wharf, carrying out chain code coding on each eight connected domain to obtain a plurality of coding results, obtaining a coding result with the longest chain code length in the plurality of coding results as a candidate coding result, sequentially judging whether direction symbols at the same position of all the candidate coding results are the same, stopping judging when the direction symbols at the same position of all the candidate coding results are different, and taking a coding result with a small direction symbol as the optimal coding of the pixel point.
Preferably, the expression of the preference degree is:
whereinIs the first in eight connected domainsTaking the pixel points as the optimal degree of the chain code wharf;is the first in eight connected domainsThe number of the optimally coded chain codes of the pixel points;is the first in eight connected domainsThe number of direction symbols in the optimal coding of each pixel point;is the eighth communication intra-domainThe number of direction symbols belonging to the first category in the optimal coding of each pixel point;is the first in eight connected domainsThe number of direction symbols belonging to the third category in the optimal codes of the pixel points;is an exponential function with a natural constant as the base.
The technical scheme of the invention has the beneficial effects that: according to the invention, the one-dimensional binary sequence is converted into the two-dimensional matrix, so that the direct relevance of data and data in the one-dimensional binary sequence can be greatly increased, the probability of the same numbers in the two-dimensional matrix being together is increased, the chain code coding compression is carried out according to the number type with less occurrence times in the two-dimensional matrix, the chain code length can be reduced, the compressed data amount is reduced, and the compression ratio is increased. The optimal coding characteristics of each pixel point are combined to obtain the optimal degree of each pixel point as the chain code wharf, so that the optimal chain code coding result is selected according to the optimal degree, and the compression efficiency of each eight-connected domain is further maximized. The compressed data in the invention is the compression result of the digits with few times of occurrence in the two-dimensional matrix, and the digits with many times of occurrence in the two-dimensional matrix are abandoned by the compression method in the invention, so that the finally obtained compressed data has small data volume and high transmission speed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating the steps of an update exception matching method based on MES interworking production data according to the present invention;
FIG. 2 is a schematic diagram of a two-dimensional matrix of the update exception matching method based on MES interworking interconnection production data of the present invention;
FIG. 3 is a visual effect diagram of the update exception matching method based on MES interworking production data of the present invention;
FIG. 4 is a schematic diagram of eight connected domains of the method for matching update exceptions based on MES interworking production data of the present invention;
FIG. 5 is a schematic diagram of a direction symbol of an eight-direction chain code of the method for updating exception matching based on MES interworking interconnection production data according to the present invention;
FIG. 6 is a schematic diagram of chain code encoding of eight connected domains of the method for updating exception matching based on MES interworking production data of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention for achieving the predetermined purpose, the following detailed description, structure, features and effects of the method for matching update exceptions based on MES interworking production data according to the present invention will be provided with reference to the accompanying drawings and the preferred embodiments. In the following description, the different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following describes a specific scheme of the update exception matching method based on MES interworking production data in detail with reference to the accompanying drawings.
Referring to fig. 1, a flowchart illustrating steps of a method for matching an update exception based on MES interworking interconnection production data according to an embodiment of the present invention is shown, where the method includes the following steps:
and S001, collecting production data, and coding the production data into a one-dimensional binary sequence.
It should be noted that the MES may provide management modules for the enterprise, including manufacturing data management, planning and scheduling management, production scheduling management, inventory management, quality management, human resource management, work center/equipment management, tool and tool management, purchasing management, cost management, project bulletin board management, production process control, bottom layer data integration and analysis, and upper layer data integration and decomposition. Therefore, the production data in the MES system is various data, the production data is usually not binary, and the computer can only recognize binary data when processing the data. Therefore, before the compression processing is performed on the production data, different types of production data need to be each converted into binary data. ASCII encoding is commonly used for uniform representation.
In the embodiment, production data is acquired, the production data is often in various forms, and for convenience of processing, various production data are converted into a uniform coding format, that is, production data in different formats are uniformly converted into a fixed-length binary coding form for representation. For example: converting the production data 'China' in the text format into a fixed-length binary code as follows: wherein the ASCII code of each letter in "China" is respectively as follows: 67. 104, 105, 110, 97, then the ASCII code is converted to eight-bit binary code: 01000011, 01101000, 01101001, 01101101110 and 01100001.
All binary codes are spliced together to form a one-dimensional binary sequence. For example, the one-dimensional binary sequence of "China" is 0100001101000011010110010110111001100001.
Thus, a one-dimensional binary sequence is obtained.
And S002, converting the one-dimensional binary sequence into a visual effect image to obtain an eight-connected domain of the foreground in the visual effect image.
It should be noted that, each number in the one-dimensional binary sequence is only associated with two adjacent numbers thereof, and in order to improve subsequent compression efficiency, the association between the numbers in the one-dimensional binary sequence needs to be increased, and the one-dimensional binary sequence may be converted into a two-dimensional matrix, so that each number in the two-dimensional matrix is associated with all numbers in the eight neighborhoods thereof.
In this embodiment, the length of the one-dimensional binary sequence (i.e. the total number of 0 and 1 in the one-dimensional binary sequence) is obtained and usedAnd (4) showing. The side length of the two-dimensional matrix after the one-dimensional binary sequence is converted into the two-dimensional matrixComprises the following steps:
in the formulaThe side length of the two-dimensional matrix is represented,representing the length of a one-dimensional binary sequence;is rounding up the symbol.
Thus constructed in a size ofA two-dimensional matrix of sizes. Sequentially filling 0 and 1 digits in the one-dimensional binary sequence into the binary sequence with the size ofIf the two-dimensional matrix has vacant positions after all the 0 and 1 digits in the one-dimensional binary sequence are filled, 0 is supplemented, so that each position in the two-dimensional matrix has a digit of 0 or 1. A schematic diagram of the two-dimensional matrix obtained is shown in fig. 2.
Therefore, a two-dimensional matrix is obtained, and it should be noted that in this embodiment, by converting the one-dimensional binary sequence into the two-dimensional matrix, the direct relevance between data in the one-dimensional binary sequence and the data can be greatly increased, and the probability that the same numbers are in the two-dimensional matrix becomes higher, so that the subsequent chain code encoding compression is performed according to the number type with fewer occurrences in the two-dimensional matrix, the length of the chain code can be reduced, the amount of stored data is reduced, and the compression ratio is increased.
Visualizing the two-dimensional matrix: and (3) expressing the number 0 in the two-dimensional matrix by using a white pixel point, and expressing the number 1 in the two-dimensional matrix by using a black pixel point, wherein the two-dimensional matrix can be regarded as a visual effect graph. The corresponding visualization effect graph after the two-dimensional matrix visualization in fig. 2 is shown in fig. 3.
It should be noted that, as can be seen from fig. 3, the frequency of the number 1 in the two-dimensional matrix is much lower than the frequency of the number 0, and meanwhile, the number 1 (black pixel in the visualization effect graph) forms a plurality of connected domains. For the information contained in the two-dimensional matrix, the information contained in the two-dimensional matrix can be obtained as long as the size of the two-dimensional matrix is known and the distribution of 0 and 1 digits in the two-dimensional matrix is known. In storing information, it is desirable that the smaller the storage amount, the better. If only the distribution information of the number 1 in the two-dimensional matrix and the size of the two-dimensional matrix are used, all information contained in the two-dimensional matrix can be finally obtained without loss.
In this embodiment, the total number of digits in the two-dimensional matrix isCounting the number of the number 0 and the number of the number 1 in the two-dimensional matrix, and dividing by twoThe number of digits 0 in the dimension matrix is notedNumber of the number 1 is noted. If it isThe number of the number 0 in the two-dimensional matrix is larger than the number of the number 1, and in order to record less number quantity in the subsequent compression process, 1 is used as a foreground (namely, black pixel points in the visual effect graph are used as the foreground), and 0 is used as a background (namely, white pixel points in the visual effect graph are used as the background); if it isThe number of the number 0 in the two-dimensional matrix is smaller than the number of the number 1, and in order to record less number quantity in the subsequent compression process, 0 is used as a foreground (namely, white pixel points in the visual effect image are used as the foreground), and 1 is used as a background (namely, black pixel points in the visual effect image are used as the background); if it isAnd randomly selecting the foreground and the background.
And acquiring the eight connected domains of the foreground in the visual effect diagram by adopting a region growing method, wherein the region growing method is the prior art and is not summarized in detail here. The foreground in fig. 3 is a black pixel, the eight connected components of the foreground in fig. 3 are regions formed by black pixels, and the schematic diagram of the eight connected components in fig. 3 is shown in fig. 4.
Thus, eight connected domains of the foreground in the visual effect graph are obtained.
And S003, acquiring the optimal code of each pixel point.
It should be noted that step S002 obtains a plurality of eight connected domains in the visualization effect map, and since the eight connected domains are not necessarily all regular connected domains (e.g., eight connected domains 3 and eight connected domains 5 in fig. 4), it is difficult to tabulate the table by the conventional methodThus, each eight-connected domain can be represented using a chain code. The eight-directional chain code defines 8 direction symbols for two adjacent pixel points according to the horizontal, vertical and two diagonal directions: 0. 1, 2, 3, 4, 5, 6, 7, and the direction symbol diagram of the eight-direction chain code is shown in fig. 5. The chain code is a group of sequence composed of the starting point of the line segment and a plurality of direction symbols, for example, eight connected components 9 in fig. 4, the first pixel point from left to right from top to bottom is obtained as the chain code dock, and the chain code encoding of the connected components is performed, so that the chain code encoding corresponding to the eight connected components 9 is:{ (1, 10), 0}, wherein (1, 10) is coordinates of a chain code terminal; 0,0 represents 4 direction symbols, and there are some direction symbols if there are some pixel points behind the chain code wharf in the connected domain. It should be noted that, in the coordinate system in this embodiment, the upper left corner of the visualization effect graph is taken as the origin of coordinates, and the horizontal direction is taken as the horizontal directionAn axis in the vertical direction ofAnd (4) establishing a plane rectangular coordinate system by using the axes.
It should be further noted that, when the eight-connected domain is encoded by using the chain code, the selected code terminal is different, and the obtained code terminal is also different. For example, in fig. 4, for an eight-connected component 2, if the first pixel point counted from left to right from top to bottom is used as a chain code terminal to perform connected component chain code encoding, the corresponding chain code is:= { (4, 1), 0,6}; if the first pixel point of the sequence number from right to left from top to bottom is taken as a chain code wharf for the coding of the chain code of the connected domain, the corresponding chain code is as follows:= { (5, 1), 4 { (5, 1), 6}; if from right to left and from bottom to topThe first pixel point of the sequence number is used as a chain code wharf to carry out connected domain chain code coding, and then the corresponding chain code is as follows:= ({ (5, 2), 2,4}. WhereinComprises two chain codes { (5, 1), 4}, { (5, 1), 6},andonly one chain code is included. On the basis of only containing one chain code, the length of the chain code corresponding to different chain code wharfs is the same, but the binary codes of the chain codes corresponding to different chain code wharfs are different. For example: chain codeThe binary code of { (4, 1), 0,6} is {100,1,0,110}, a homologus chain codeThe binary coding of { (5, 2), 2,4} is {101,10, 100}. Chain codeThe number of bits occupied by the binary code of (2) is 8 bits, and the chain codeThe bit number occupied by the binary code is 10 bits, therefore, different chain code wharfs are adopted for the same eight-connected domain to carry out chain code coding, and the bit numbers occupied by the finally obtained binary codes are also different. Therefore, in order to ensure the compression rate of the production data, the optimal degree of each pixel point in the eight-connected domain as the chain code wharf needs to be calculated, and a plurality of chain code encoding results may be obtained by using one pixel point in the eight-connected domain as the chain code wharf, as shown in fig. 6, for each pixel point in the eight-connected domain, the method for generating the chain code wharf is applied to the eight-connected domain<xnotran> 6 (a) , , { (1,3), 0,0,7,0,0,2,2,2,4,4,4,6} { (1,3), 0,0,2,2,0,0,0,6,6,6,4,4}, </xnotran>、. WhereinIn correspondence with figure 6 (b),corresponding to fig. 6 (c). Therefore, before calculating the optimal degree of each pixel point in the eight connected domain as the chain code wharf, the optimal chain code when each pixel point in the eight connected domain is used as the chain code wharf needs to be obtained first, and the optimal chain code when each pixel point in the eight connected domain is used as the chain code wharf is recorded as the optimal code of each pixel point.
In this embodiment, the optimal encoding obtaining method for each pixel point is as follows:
and in the process, if the chain code lengths of the plurality of coding results are the longest and equal, the coding results are used as candidate coding results, whether direction symbols at the same position of all the candidate coding results are the same or not is sequentially judged, and when the direction symbols at the same position of all the candidate coding results are different, the judgment is stopped, and the coding result with the small direction symbol is used as the final optimal coding of the pixel point. For example, the eight-connected domain composed of black pixels in fig. 6 (a) is chain-coded, and the first pixel counted from left to right and from bottom to top is the chain-coded dock, so as to obtain two chain-coded resultsAndare the same in length, butAndif the 3 rd direction symbol is 7, 2, then select the chain code coding result corresponding to the smaller direction symbol 2And the optimal code of the pixel point (1, 3) is obtained.
Thus, the optimal code of each pixel point in each eight-connected domain is obtained.
And S004, acquiring the optimal degree of each pixel point as a chain code wharf.
It should be noted that, the number of chain codes in the optimal codes corresponding to different chain code terminals may be different, and since each multiple chain code may cause the coordinates of the chain code terminal to be represented once in the optimal code, the storage amount is inevitably increased, and therefore, it is desirable that the number of chain codes is smaller as well as better. The bits occupied by the conversion of different direction symbols into binary numbers are different, direction symbols 0 and 1 into binary numbers occupy 1 bit, direction symbols 2 and 3 into binary numbers occupy 2 bits, and direction symbols 4, 5, 6 and 7 into binary numbers occupy 3 bits. To ensure the compression effect, it is desirable that the smaller the occupation ratio of the direction symbols in the optimal coding, the better.
In this embodiment, all the different direction indicators 0,1, 2, 3, 4, 5, 6, 7 are first classified into three categories, 0 and 1 are classified into a first category, 2 and 3 are classified into a second category, and 4, 5, 6, 7 are classified into a third category.
For the second of eight connected domainsEach pixel point respectively acquires the number of direction symbols belonging to each category in the optimal code of the pixel point and respectively records the number as the direction symbols. Recording the number of all direction symbols in the optimal coding of the pixel point as. Recording the number of chain code bars in the optimal coding of the pixel point as. Then with an eighth connectivity domainThe optimal degree of each pixel point as a chain code wharfComprises the following steps:
whereinIs the first in eight connected domainsTaking the pixel points as the optimal degree of the chain code wharf;is the first in eight connected domainsThe number of the optimally coded chain codes of the pixel points;is in eight connected domainsFirst, theThe number of direction symbols in the optimal coding of each pixel point;is the eighth communication intra-domainThe number of direction symbols belonging to the first category in the optimal codes of the pixel points;is the eighth communication intra-domainThe number of direction symbols belonging to the third category in the optimal coding of each pixel point;is an exponential function with a natural constant as a base;is the eighth communication intra-domainThe ratio of direction symbols belonging to the first category in the optimal encoding of each pixel is added to 0.00001 to prevent the occurrence of false errorsIs 0 results in Is 0; when it comes toThe less the number of chain codes in the optimal coding of each pixel point, the more the number of direction symbols belonging to the first category is, and the more the number of direction symbols belonging to the third category isWhen the number of bits occupied by the optimal codes of the current pixel points converted into the binary codes is small, the preference degree of the current pixel points as the chain code wharf is large.
And in the same way, acquiring the optimal degree of each pixel point in each eight-connected domain as a chain code wharf. It should be noted that, in this embodiment, the optimal encoding characteristic of each pixel point is combined to obtain the optimal degree of each pixel point as the chain code wharf, so that the optimal chain code encoding result is selected according to the optimal degree subsequently, and the compression efficiency of each eight-connected domain is further maximized.
And S005, acquiring compressed data.
And taking all pixel points in the eight connected domains as pixel points corresponding to the maximum optimization degree in the optimization degrees of the chain code wharfs as final chain code wharfs, and taking the optimal codes corresponding to the final chain code wharfs as optimal chain code coding results. And converting the optimal chain code coding result into binary coding as a compression result of the corresponding eight-connected domain. For example, the optimal chain code encoding result of the octal-connected domain 2 in FIG. 4 is= { (4, 1), 0,6}, and the compression result is {100,1,0,110}.
And taking the compression results of all the eight connected domains as compressed data.
At this point, compressed data is obtained. For compressed data, length of one-dimensional binary sequenceAnd the side length of the two-dimensional matrixFor storage or transmission. In addition, since the compressed data is used to compress the foreground, the data corresponding to the foreground needs to be stored or transmitted, for example, if the number 1 is the foreground, the number 1 is stored or transmitted, and if the number 0 is the foreground, the number 0 is stored or transmitted.
It should be noted that the compressed data in this embodiment is a compressed result of a number with a small occurrence number in the two-dimensional matrix, and a large amount of data in the two-dimensional matrix is discarded (i.e., a number with a large occurrence number is discarded) by the compression method in this embodiment, so that the finally obtained compressed data has a small data size and a high transmission speed.
And S006, performing production data abnormity analysis according to the compressed data of the adjacent time periods.
The method for decompressing the compressed data comprises the following steps:
firstly, a dimension of the two-dimensional matrix is constructed according to the side length of the two-dimensional matrixAnd establishing a corresponding plane rectangular coordinate system. And converting the binary codes in the compression results into decimal numbers to obtain a plurality of chain code coding results. And filling the number corresponding to the foreground at the coordinate position of the chain code wharf of each chain code coding result in the two-dimensional matrix according to the number corresponding to the foreground, and filling the number corresponding to the foreground at the corresponding position sequentially according to the direction symbol in the chain code coding result. And filling complementary numbers of the numbers corresponding to the foreground in the vacant positions of the two-dimensional matrix after filling the corresponding positions of all the chain code coding results in the two-dimensional matrix. If the number corresponding to the foreground is 1, the complementary number is 0, and if the number corresponding to the foreground is 0, the complementary number is 1. Thus, a two-dimensional matrix is obtained.
According to the length of one-dimensional binary sequenceAnd converting the two-dimensional matrix into a one-dimensional binary sequence, and performing inverse transformation operated in the step S001 on the one-dimensional binary sequence to obtain original production data.
It should be noted that the production data in this embodiment is data collected by the control layer in the production process in real time, the production data in a period of time is compressed by using the method in this embodiment according to the initially set data transmission frequency, a control layer production data compression packet in the current period of time is formed, and the production data compression packet is transmitted to the MES system and is analyzed and processed by the MES system. Because the data acquisition period in the production process is not too long, for example, when the data transmission frequency is 10 minutes, each production data compression packet contains 10 minutes of data in the production process, the data sizes in the adjacent production data compression packets are basically consistent under normal conditions, when the data sizes in the adjacent production data compression packets are deviated, the data are represented to be abnormal, at the moment, the MES system performs emphasis analysis on the production data compression packets, transmits the analysis result to the control layer, and regulates and controls the corresponding production process.
Through the steps, compression transmission and decompression of production data are completed.
According to the embodiment of the invention, the one-dimensional binary sequence is converted into the two-dimensional matrix, so that the direct relevance of data and data in the one-dimensional binary sequence can be greatly increased, the probability of the same numbers in the two-dimensional matrix being together is increased, and the chain code length can be reduced by performing chain code coding compression according to the number type with less occurrence times in the two-dimensional matrix, so that the data compression amount is reduced, and the compression ratio is increased. According to the embodiment of the invention, the optimal coding characteristic of each pixel point is combined to obtain the optimal degree of each pixel point as the chain code wharf, so that the optimal chain code coding result is selected according to the optimal degree subsequently, and the compression efficiency of each eight-connected domain is further maximized. The compressed data in the embodiment of the invention is the compression result of the digits with few occurrence times in the two-dimensional matrix, and the digits with many occurrence times in the two-dimensional matrix are abandoned by the compression method in the embodiment of the invention, so that the finally obtained compressed data has small data volume and high transmission speed.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. An updating exception matching method based on MES intercommunication interconnected production data is characterized by comprising the following steps:
collecting production data, and encoding the production data into a one-dimensional binary sequence; converting the one-dimensional binary sequence into a two-dimensional matrix; converting the two-dimensional matrix into a visual effect diagram;
acquiring a foreground and a background in the visual effect image according to the number of the numbers 0 and the number of the numbers 1 in the two-dimensional matrix; acquiring an eight-connected domain of a foreground in a visual effect graph;
classifying all direction symbols of the eight-direction chain codes to obtain a plurality of categories;
taking each pixel point in each eight-connected domain as a chain code wharf, and performing chain code coding on each eight-connected domain to obtain the optimal coding of each pixel point; acquiring the optimal degree of each pixel point as a chain code wharf according to the optimal code of each pixel point and the category of each direction symbol in the optimal code;
taking all pixel points in the eight-connected domain as pixel points corresponding to the maximum optimization degree in the optimization degrees of the chain code wharf as a final chain code wharf, and converting the optimal code corresponding to the final chain code wharf into a binary system as a compression result;
and transmitting the compression result to an MES system, decompressing the compression result through the MES system to obtain decompressed production data, matching the decompressed production data between adjacent sampling frequencies, and if the decompressed production data between the adjacent sampling frequencies have deviation, determining that the corresponding decompressed production data have abnormity.
2. The method as claimed in claim 1, wherein the step of collecting the production data and encoding the production data into a one-dimensional binary sequence comprises the following steps:
and carrying out fixed-length binary coding on the production data, and splicing all binary codes together to form a one-dimensional binary sequence.
3. The method for matching update exceptions based on MES interworking interconnection production data of claim 1 wherein the converting the one-dimensional binary sequence into a two-dimensional matrix comprises the specific steps of:
squaring the length of the one-dimensional binary sequence, and rounding the result upwards to obtain the length of the side lengthConstruction ofAnd (3) filling binary digits in the one-dimensional binary sequence into the two-dimensional matrix according to the sequence of the two-dimensional matrix, and performing 0 complementing operation on vacant positions of the two-dimensional matrix.
4. The method for updating exception matching based on MES interworking interconnection production data as claimed in claim 1, wherein said converting the two-dimensional matrix into the visual effect graph comprises the following steps:
and expressing the number 0 in the two-dimensional matrix by using a white pixel point, and expressing the number 1 in the two-dimensional matrix by using a black pixel point to obtain a visual effect graph.
5. The method for updating exception matching based on MES interworking interconnection production data according to claim 1, wherein the obtaining the foreground and the background in the visualization effect chart according to the number of the number 0 and the number of the number 1 in the two-dimensional matrix comprises the following specific steps:
if the number of the numbers 0 in the two-dimensional matrix is larger than the number of the numbers 1, taking black pixel points in the visual effect image as a foreground and white pixel points as a background; if the number of the numbers 0 in the two-dimensional matrix is smaller than the number of the numbers 1, taking white pixel points in the visual effect image as a foreground and black pixel points as a background; and if the number of the numbers 0 in the two-dimensional matrix is the same as that of the numbers 1, randomly selecting the foreground and the background.
6. The method for matching update exception of MES interworking interconnection production data according to claim 1, wherein said classifying all direction symbols of the eight-direction chain code to obtain a plurality of classes comprises the following steps:
all direction symbols of the eight-direction chain code comprise 0,1, 2, 3, 4, 5, 6 and 7, wherein 0 and 1 are divided into a first category, 2 and 3 are divided into a second category, and 4, 5, 6 and 7 are divided into a third category.
7. The method for updating exception matching based on MES interworking interconnection production data according to claim 1, wherein said step of performing chain code coding on each eight-connected domain by using each pixel point in each eight-connected domain as a chain code dock to obtain the optimal code of each pixel point comprises the following specific steps:
and taking one pixel point in the eight connected domains as a chain code wharf, carrying out chain code coding on each eight connected domain to obtain a plurality of coding results, obtaining a coding result with the longest chain code length in the plurality of coding results as a candidate coding result, sequentially judging whether direction symbols at the same position of all the candidate coding results are the same, stopping judging when the direction symbols at the same position of all the candidate coding results are different, and taking a coding result with a small direction symbol as the optimal coding of the pixel point.
8. The method as claimed in claim 1, wherein the expression of the preference degree is:
whereinIs the first in eight connected domainsTaking the pixel points as the optimal degree of the chain code wharf;is the first in eight connected domainsThe number of the optimally coded chain codes of the pixel points;is the eighth communication intra-domainThe number of direction symbols in the optimal coding of each pixel point;is the first in eight connected domainsThe number of direction symbols belonging to the first category in the optimal codes of the pixel points;is the first in eight connected domainsThe number of direction symbols belonging to the third category in the optimal coding of each pixel point;is an exponential function with a natural constant as the base.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211482181.7A CN115529357B (en) | 2022-11-24 | 2022-11-24 | Updating abnormity matching method based on MES intercommunication interconnection production data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211482181.7A CN115529357B (en) | 2022-11-24 | 2022-11-24 | Updating abnormity matching method based on MES intercommunication interconnection production data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115529357A CN115529357A (en) | 2022-12-27 |
CN115529357B true CN115529357B (en) | 2023-03-03 |
Family
ID=84704711
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211482181.7A Active CN115529357B (en) | 2022-11-24 | 2022-11-24 | Updating abnormity matching method based on MES intercommunication interconnection production data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115529357B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115815939B (en) * | 2023-02-20 | 2023-05-16 | 国网山东省电力公司东营供电公司 | Auxiliary positioning method for capacitor installation |
CN116612437B (en) * | 2023-07-20 | 2023-10-03 | 华洋通信科技股份有限公司 | Large-block coal transportation data processing system based on recognition result |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102255873B (en) * | 2010-05-21 | 2014-01-01 | 南京师范大学 | Method for transmission of vector data on the basis of pixel non-destructive compression of ordered point set |
CN113727105B (en) * | 2021-09-08 | 2022-04-26 | 北京医百科技有限公司 | Depth map compression method, device, system and storage medium |
CN114726926B (en) * | 2022-03-30 | 2023-03-31 | 电子科技大学 | Self-adaptive variable length coding method for Laplace information source |
-
2022
- 2022-11-24 CN CN202211482181.7A patent/CN115529357B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN115529357A (en) | 2022-12-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115529357B (en) | Updating abnormity matching method based on MES intercommunication interconnection production data | |
CN110602491B (en) | Intra-frame chroma prediction method, device and equipment and video coding and decoding system | |
CN104853209B (en) | Image coding and decoding method and device | |
CN116506073B (en) | Industrial computer platform data rapid transmission method and system | |
CN111699696A (en) | Method and apparatus for encoding and decoding a byte stream | |
CN113473127B (en) | Point cloud geometric coding method, point cloud geometric decoding method, point cloud geometric coding equipment and point cloud geometric decoding equipment | |
US20090016453A1 (en) | Combinatorial coding/decoding for electrical computers and digital data processing systems | |
CN105100814B (en) | Image coding and decoding method and device | |
CN112003625A (en) | Huffman coding method, system and equipment | |
CN104838653A (en) | Lossless image compression using differential transfer | |
CN103632179B (en) | Code And Decode method and the device of Three-Dimensional Bar Code | |
CN115208414B (en) | Data compression method, data compression device, computer device and storage medium | |
US20220005229A1 (en) | Point cloud attribute encoding method and device, and point cloud attribute decoding method and devcie | |
CN115955513A (en) | Internet of things data optimized transmission method | |
CN112016270B (en) | Logistics information coding method, device and equipment of Chinese-character codes | |
CN115632661B (en) | Efficient compression transmission method for network security information | |
CN102298782B (en) | System and method for parameter estimation for lossless video compression | |
CN116030114A (en) | Manufacturing method, device, equipment and medium of bioelectrical homologous electronic impression | |
CN117156069B (en) | Software image data encryption transmission method | |
CN112200301B (en) | Convolution computing device and method | |
JP2526783B2 (en) | Region shape encoding / decoding method | |
CN109409460A (en) | A method of list data is transmitted using two dimensional code | |
CN118399976B (en) | Remote monitoring method and system for equipment operation data | |
CN117544177A (en) | Radar data lossless compression method, computer equipment and medium | |
CN116094694A (en) | Point cloud geometric coding method, decoding method, coding device and decoding device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |