CN108073592B - Method for judging whether sequence number is repeated or not and method for writing in sequence number of television - Google Patents
Method for judging whether sequence number is repeated or not and method for writing in sequence number of television Download PDFInfo
- Publication number
- CN108073592B CN108073592B CN201610990914.6A CN201610990914A CN108073592B CN 108073592 B CN108073592 B CN 108073592B CN 201610990914 A CN201610990914 A CN 201610990914A CN 108073592 B CN108073592 B CN 108073592B
- Authority
- CN
- China
- Prior art keywords
- repeated
- serial number
- mac
- client
- data
- 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Computer And Data Communications (AREA)
- General Factory Administration (AREA)
Abstract
The invention discloses a method for judging whether a serial number is repeated and a method for writing a serial number of a television. The method for judging whether the sequence numbers are repeated comprises the following steps: the client receives a serial number and an MAC number to be judged; a client queries a database; after the database query is completed, the client judges whether the serial number and the MAC number are repeated; if the serial number and the MAC number are judged to be repeated, the client writes the repeated serial number and the MAC number into an XLS document; and if the serial number and the MAC number are not repeated, the client writes the serial number and the MAC number into the database. Before the serial number and the MAC number are written into an electric appliance such as a television, a set top box or a vehicle-mounted terminal, whether the serial number and the MAC number are repeated or not is judged, repeated writing of the serial number and the MAC number can be effectively avoided, later-stage labor input is reduced, and processing efficiency is improved. The method for judging whether the serial numbers are repeated can be used for different production lines, and the repetition of the serial numbers and the MAC numbers between different production lines is avoided.
Description
Technical Field
The invention relates to the field of computers, in particular to a method for judging whether a serial number is repeated or not and a writing method of a television serial number.
Background
Before the television leaves a factory, a serial number needs to be written into the television, and the serial number written into each television is required to be unique and can not be repeated. Under the existing technical conditions, the serial number is not repeatedly written into the television because the serial number is not repeatedly written into the television before being written into the television and the serial numbers of different televisions in different production lines are not inquired, so that the subsequent manpower input is greatly increased and the production efficiency is reduced.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method for judging whether the serial number is repeated and a method for writing the serial number of a television.
According to a first aspect of the present invention, disclosed herein is a method of determining whether a sequence number is repeated, comprising:
data receiving: the client receives a serial number and an MAC number to be judged;
database query: a client queries a database;
judging whether the data are repeated: after the database query is completed, the client judges whether the serial number and the MAC number are repeated;
data processing: if the serial number and the MAC number are judged to be repeated, the client writes the repeated serial number and the repeated MAC number into the XLS document; and if the serial number and the MAC number are not repeated, the client writes the serial number and the MAC number into the database.
According to an embodiment of the present invention, the database querying step includes:
if the network is in a connection state, the client firstly queries the remote database, performs local database query after completing the remote database query, and executes the step of judging whether the data is repeated or not after completing the local database query;
if the network is in a disconnected state, only the local database is queried, and after the query of the local database is completed, the step of judging whether the data is repeated is executed.
According to an embodiment of the present invention, the data processing step includes: a substep of setting a repeated flag bit and a substep of judging whether the data flag bit is repeated or not:
setting a repeated flag bit:
if the network is in a connection state and the serial number and the MAC number are judged to be repeated, the client sets a local repeated data flag bit and a remote repeated data flag bit, and then executes a substep of judging whether the data flag bits are repeated or not; if the serial number and the MAC number are not repeated, directly executing a substep of judging whether the data zone bit is repeated or not;
if the network is in a disconnected state and the serial number and the MAC number are judged to be repeated, the client sets a local repeated data flag bit, and then executes the substep of judging whether the data flag bit is repeated or not; if the serial number and the MAC number are not repeated, directly executing a substep of judging whether the data zone bit is repeated or not;
judging whether the data zone bit is repeated:
if the network is in a connection state, the client judges whether the remote data zone bit and the local data zone bit are repeated: if the serial number and the MAC number are repeated, the client writes the serial number and the MAC number into an XLS document; if not, the client writes the serial number and the MAC number into a remote database and a local database;
if the network is in a disconnected state, the client judges whether the local data zone bit is repeated: if the serial number and the MAC number are repeated, the client writes the serial number and the MAC number into an XLS document; and if not, the client writes the serial number and the MAC number into a local database.
According to an embodiment of the invention, the method further comprises the steps of:
and (3) server side data judgment: if the network is in a connection state, the client side sends the received serial number and the MAC number to be judged to the server side, the server side receives the serial number and the MAC number, the server side inquires a remote database and a local database and judges whether the serial number and the MAC number are repeated, if so, the server side feeds back a judgment result to the client side, and the client side executes a database inquiry step; if not, the server side feeds back a judgment result to the client side, the serial number and the MAC number are written into a remote database and a local database, and the client side executes the database query step.
According to an embodiment of the present invention, in the server-side data determination, the step of sending the received serial number and MAC number to be determined to the server side by the client side includes the following substeps:
and (3) data format conversion: converting the obtained serial number and MAC number into a character string format;
character string segmentation: dividing fields in the character string format by using '″ or t';
a sending field: sending each divided field;
the server side receives the serial number and the MAC number and comprises the following substeps:
receiving a field: receiving each field sent by a client;
storing fields and querying a database: storing each field into a tuple;
and then the server side inquires the remote database and the local database.
According to an embodiment of the present invention: in the server side data judgment, the client side and the server side carry out network communication through a TCP socket, and the server side receives the serial number and the MAC number to be judged, which are sent by the client side, through a TCP socket communication mode.
According to an embodiment of the present invention, writing duplicate serial and MAC numbers into an XLS document includes:
reading the repeated serial number and the MAC number into a file stream;
acquiring a working table of XLS and an empty row which needs to be written into the working table of XLS;
writing the repeated serial number and the MAC number into the corresponding cell of the empty row;
the Flush file stream is closed.
According to an embodiment of the present invention, the method further comprises the step of listening port: the server monitors the ports of the clients simultaneously, establishes communication connection with the clients respectively, receives the receiving serial numbers and the MAC numbers sent by the clients respectively, and then executes the server data judgment step.
Before the serial number and the MAC number are written, whether the serial number and the MAC number are repeated or not is judged, so that the follow-up repeated writing of the serial number and the MAC number can be avoided, and the manual operation is increased. The method is applied to a plurality of production lines, and can also avoid the phenomenon of repeated sequence numbers among the production lines under the condition that the production lines share one server. In the preferred embodiment, the communication between the client and the server adopts TCP sockets, so that the repetition of serial numbers between different production lines can be more effectively avoided, and the method for judging the repetition of the serial numbers has higher data speed, thereby ensuring that the serial numbers of the produced products are not repeated, greatly simplifying the follow-up of production and being more beneficial to the follow-up manual operation.
According to a second aspect of the present invention, there is disclosed herein a method for writing a serial number of a television, comprising:
sending sequence number and MAC number: the serial number writing software respectively sends the serial number to be written and the MAC number to the client;
data receiving: a client receives a serial number to be processed and an MAC number;
database query: a client queries a database;
judging whether the data are repeated: after the database query is completed, the client judges whether the serial number and the MAC number are repeated;
data processing: if the serial number and the MAC number are judged to be repeated, the client feeds back a judgment result to each serial number writing software, and writes the repeated serial number and the repeated MAC number into an XLS document; if the serial number and the MAC number are not repeated, the client feeds back a judgment result to each serial number writing software, and writes the serial number and the MAC number into a database;
writing a sequence number: if the serial number and the MAC number are not repeated, the serial number writing software writes the serial number and the MAC number into the corresponding television, and if the serial number and the MAC number are repeated, the serial number and the MAC number are not written.
The writing method of the serial number of the television can avoid repeated writing of the serial number and the MAC number between different televisions and different production lines, greatly reduces the later human input caused by repeated writing of the serial number and the MAC number, and simultaneously improves the processing efficiency.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flowchart illustrating client software according to one embodiment;
FIG. 2 is a flowchart of server-side software according to one embodiment;
FIG. 3 is a block diagram of a client software architecture according to an embodiment;
FIG. 4 is a flow chart of the operation XLS of the NPOI component in the first embodiment;
fig. 5 is a flowchart illustrating the execution of the SQLite3 command in the first embodiment.
Detailed Description
In the following description, for purposes of explanation, numerous implementation details are set forth in order to provide a thorough understanding of the various embodiments of the present invention. It should be understood, however, that these implementation details are not to be interpreted as limiting the invention. That is, in some embodiments of the invention, such implementation details are not necessary. In addition, some conventional structures and components are shown in simplified schematic form in the drawings.
The invention relates to a method for judging whether a serial number is repeated and a method for writing a serial number of a television. The invention can solve the problem of repeated writing of the serial number and the MAC number in the production of the television, and particularly avoids the phenomenon of repeated writing of the serial number and the MAC number of the television between different production lines. By connecting the serial number writing software of each production line to the server in a TCP socket mode, the non-repetition of serial numbers and MAC numbers among the production lines is realized under the condition that the production lines share one database of the server, the repeated serial numbers and MAC numbers are prompted, and the operation of XLS documents is recorded so as to facilitate the subsequent manual operation. In addition, the method for judging whether the serial number is repeated and the writing method of the serial number of the television can be used for other products needing to write the serial number and the MAC number, such as a set top box or a vehicle-mounted terminal, and the like, so that the serial number and the MAC number can be prevented from being written repeatedly, manual operation is saved, and the production efficiency is improved.
In addition, the client side is realized by using C #, the server side is realized by using Python, the data storage and query of the client side and the server side are based on SQLite3, and the communication between the client side and the server side adopts TCP sockets.
Hereinafter, the method for determining whether the serial number is duplicated and the method for writing the serial number of the television according to the present invention will be described in detail in two embodiments.
The first embodiment is as follows:
in this embodiment, the method for determining whether the sequence number is repeated sequentially includes the following steps: receiving data, inquiring a database, judging whether the data are repeated or not and processing the data, specifically:
data reception: the client receives a serial number and an MAC number to be judged;
database query: a client queries a database;
judging whether the data are repeated: after the database query is completed, the client judges whether the serial number and the MAC number are repeated;
data processing: if the serial number and the MAC number are judged to be repeated, the client writes the repeated serial number and the MAC number into an XLS document; and if the serial number and the MAC number are not repeated, the client writes the serial number and the MAC number into the database.
The serial number and the MAC number which need to be judged can be directly input to the client through a user interface, the serial number and the MAC number can be scanned by a code scanner, or the serial number and the MAC number are generated by serial number writing software and then are sent to the client, the client inquires a database, after the database inquiry is completed, the client judges whether the data is repeated, the client processes the data according to the judgment result and feeds the judgment result back to the user. Specifically, after the client finishes querying, the client compares the received serial number and MAC number with the serial number and MAC number stored in the database to determine whether the data is duplicated.
Hereinafter, the present embodiment will describe the method for determining whether a sequence number is repeated according to the present invention by taking two cases, namely, a case where a network is in a connected state and a case where the network is in a disconnected state as an example.
Network in connected state
If the network is in a connected state, the specific process of the method for determining whether the sequence number is repeated is as follows, please refer to fig. 1:
data receiving: the client receives a serial number and an MAC number to be judged;
after the client receives the serial number and the MAC number, the following database query steps are executed:
database query: the client firstly queries a remote database, performs local database query after completing remote database query, and executes the step of judging whether data is repeated or not after completing local database query;
judging whether the data are repeated: after the remote database query and the local database query are completed, the client judges whether the serial number and the MAC number are repeated or not, and then executes a data processing step;
after judging whether the data are repeated, in order to further confirm which group of data are repeated, the method also comprises a data processing step, and the data processing step comprises the following steps: a substep of setting a repeated flag bit and a substep of judging whether the data flag bit is repeated or not:
setting a repeated flag bit: if the serial number and the MAC number are judged to be repeated, the client sets a local repeated data flag bit and a remote repeated data flag bit, and then executes a substep of judging whether the data flag bits are repeated or not; if the serial number and the MAC number are not repeated, directly executing a substep of judging whether the data zone bit is repeated or not;
judging whether the data zone bit is repeated: the client judges whether the remote data zone bit and the local data zone bit are repeated: if the serial number and the MAC number are repeated, the client writes the serial number and the MAC number into an XLS document; if not, the client writes the serial number and the MAC number into a remote database and a local database.
In this example, the database query operation of the client is divided into a local database query and a remote database query. If the network is in a connection state, when a client queries a local database and a remote database, a large amount of time is consumed in order to avoid simultaneous remote database query and local database query, wherein the remote database query is performed in a main thread, the local database query is performed in a thread, before the remote data and the local data are judged to be repeated, the main thread waits until the local database query is finished, after the query of the local database and the remote database is completed, the main thread judges whether the data are repeated together, and then the operation of a data repetition flag bit is mainly performed. If the sequence number and the MAC number are repeated after the local database and the remote database complete the query, setting a local repeated data flag and a remote repeated data flag, and then judging whether the local data flag and the remote data flag are repeated by the client; if the local database and the remote database are inquired and the serial numbers and the MAC numbers are not repeated, the client directly judges whether the local data zone bits and the remote data zone bits are repeated or not, and judges whether the local data zone bits and the remote data zone bits are repeated or not so as to further confirm which group of serial numbers and MAC numbers are repeated. If the local data zone bit and the remote data zone bit are repeated, the client writes the serial number and the MAC number into the XLS document and prompts a user through the client, and if the local data zone bit and the remote data zone bit are not repeated, the client directly writes the serial number and the MAC number into the local database and the remote database and prompts the user.
In a preferred embodiment, after receiving the serial number and the MAC number, the client may further send the serial number and the MAC number to the server, and the server performs data determination, please refer to fig. 2. The server side monitors a port and establishes connection with the client side, the server side starts a thread to receive the serial number and the MAC number and receives the serial number and the MAC number sent by the client side, the server side inquires a remote database and a local database and judges whether the serial number and the MAC number are repeated or not, and if the serial number and the MAC number are repeated, the server side feeds back a judgment result to the client side; if not, the server side feeds back a judgment result to the client side, and writes the serial number and the MAC number into the remote database and the local database. After the determination result is fed back to the client, the client continues to determine whether the serial number and the MAC number are repeated according to the flow shown in fig. 1. The server side feeds back the judgment result to the client side, and the values and meanings fed back by the server side are shown in the table 1:
means of | Feedback value |
Sequence number duplication | Duplicate SN |
LAN MAC repetition | Duplicate LAN |
WIFI MAC repetition | Duplicate WIFI |
BT MAC repetition | Duplicate BT |
New data | New data |
TABLE 1
Fig. 3 is a block diagram of a client software structure, wherein in fig. 3, the main functions of the user interface are to implement interaction with a user and communication with other structures, such as inputting a serial number and a MAC number and displaying a data judgment result. When a serial number and an MAC number which need to be judged are input through user interface operation, after the serial number and the MAC number are input, when a client sends the serial number and the MAC number to a server, the client and the server communicate through a TCP socket, the client sends the serial number and the MAC number to the server, and the server receives the serial number and the MAC number; and the server side judges whether the data are repeated or not and feeds back the judgment result to the client side through the TCP socket. The TCP socket is used for data communication between the client and the server and has a data transmission function, and particularly, the client and the server establish communication through the TCP socket; the client sends the serial number and the MAC number to the server in a TCP socket mode, and the server sends a judgment result of whether the data is repeated to the client in the TCP socket mode.
When the client judges that the serial number and the MAC number are repeated, the NPOI component operates XLS for the repeated data and writes the serial number and the MAC number into the XLS; for non-repetitive data, the SQLite3 database operates to store the data.
Referring to FIG. 4, the client writing duplicate data to an XLS document is primarily accomplished by means of an open source NPOI component, which is employed to write the duplicate data to the XLS document. For duplicate data, the NPOI component operates an XLS that writes duplicate data into an XLS document, the flow of the NPOI component operating the XLS is shown in fig. 4 and includes:
reading the repeated serial number and the MAC number into a file stream;
acquiring a working table of XLS and an empty row which needs to be written into the working table of XLS;
writing the repeated serial number and the MAC number into the corresponding cell of the empty row;
the Flush file stream is closed.
If the data is not duplicated, referring to fig. 5, the SQLite3 database operates to store the local data, and the SQLite3 command execution flow is shown in fig. 5.
The client sets the repeated flag bit firstly and then judges whether the flag bit is repeated or not, so that the judgment on whether the data is repeated or not can be realized, and the repeated data can be further confirmed so as to carry out manual operation on the repeated data.
In the above server data judgment, the client sends the received serial number and MAC number to be judged to the server, and the sub-steps include:
data format conversion: converting the obtained serial number and the MAC number into a character string format;
character string segmentation: dividing fields in the character string format by using '″ or t';
a sending field: sending each divided field;
the server side receives the serial number and the MAC number and comprises the following substeps:
receiving a field: receiving each field sent by a client;
storing fields and querying a database: storing each field into a tuple;
and then the server side inquires the remote database and the local database.
(II) the network is in a disconnected state
If the network is in the disconnected state, the specific process of the method for determining whether the serial number is repeated is as follows, please refer to fig. 2 for understanding together:
data receiving: the client receives a serial number and an MAC number to be judged;
after the client receives the serial number and the MAC number, the following database query steps are executed:
database query: the client side inquires a local database, and executes the step of judging whether the data is repeated or not after the local database inquiry is finished;
judging whether the data are repeated: after the local database is inquired, the client judges whether the serial number and the MAC number are repeated, and then executes a data processing step;
after judging whether the data are repeated, in order to further confirm which group of data are repeated, the method also comprises a data processing step, and the data processing step comprises the following steps: a substep of setting a repeated flag bit and a substep of judging whether the data flag bit is repeated or not:
setting a repeated flag bit: if the serial number and the MAC number are judged to be repeated, the client sets a local repeated data flag bit, and then executes a substep of judging whether the data flag bit is repeated; if the serial number and the MAC number are not repeated, directly executing a substep of judging whether the data zone bit is repeated or not;
judging whether the data zone bit is repeated: the client judges whether the local data zone bit is repeated: if the serial number and the MAC number are repeated, the client writes the serial number and the MAC number into an XLS document; if not, the client writes the serial number and the MAC number into a local database.
The operation of writing the repeated data into the XLS document by the client is the same as the operation of the client in a connected state with the network, as shown in fig. 3, which is not described herein again. If the data is not duplicated, referring to fig. 4, the SQLite3 database operates to store the local data, and the execution flow of the SQLite3 command is shown in fig. 4.
If the network connection is in the disconnected state, only the query of the local database is executed. If the local database is queried and the serial number and the MAC number are repeated, setting a local repeated data mark, and then, judging whether the local data mark bit is repeated or not by the client; if the local database finishes the query and judges that the serial number and the MAC number are not repeated, the client directly judges whether the zone bit of the local data is repeated or not, and judges whether the zone bit of the local data is repeated or not so as to further confirm which group of serial numbers and MAC numbers are repeated. If the local data zone bit is repeated, the client writes the serial number and the MAC number into the XLS document and prompts the user, and if the local data zone bit is not repeated, the client directly writes the serial number and the MAC number into a local database and prompts the user.
Since the above operations of writing in the database and writing in the XLS document are time consuming, in this example, the method of determining whether the serial number and the MAC number are repeated is performed in two threads, and at this time, to avoid the conflict between the threads, a lock mechanism is added, so that it is ensured that other operations cannot obtain the two files when one thread uses the database or the XLS document.
If the serial numbers of a plurality of production lines are judged to be repeated at the same time, the server side monitors the ports of a plurality of client sides at the same time, communication connection is respectively established with the client sides through TCP sockets, a thread processing mode is established for each communication connection, after the threads are established, a main thread continues to monitor the ports of specific client sides, and the threads receive data, inquire a database, judge whether the data are repeated, process the data and feed back judgment results.
Before the serial number and the MAC number are written in, whether the serial number and the MAC number are repeated or not is judged, so that the follow-up repeated writing of the serial number can be avoided, and the manual operation is increased. The method is applied to a plurality of production lines, and under the condition that the production lines share one server, the phenomenon that sequence numbers and MAC numbers are repeated among the production lines can be avoided. In the preferred embodiment, the communication between the client and the server adopts TCP sockets, so that the repetition of serial numbers and MAC numbers between different production lines can be more effectively avoided, and the method for judging the repetition of the serial numbers has higher data speed, thereby ensuring that the serial numbers and the MAC numbers of the produced products are not repeated, greatly simplifying the follow-up of the production and being more beneficial to the follow-up manual operation.
Example two:
the embodiment provides a method for writing a serial number of a television, which comprises the following steps:
transmission sequence number and MAC number: the serial number writing software respectively sends the serial number to be written and the MAC number to the client;
data reception: a client receives a serial number to be processed and an MAC number;
database query: a client queries a database;
judging whether the data is repeated: after the database query is completed, the client judges whether the serial number and the MAC number are repeated;
data processing: if the serial number and the MAC number are judged to be repeated, the client feeds back a judgment result to each serial number writing software, and writes the repeated serial number and the repeated MAC number into an XLS document; if the serial number and the MAC number are not repeated, the client feeds back a judgment result to each serial number writing software, and writes the serial number and the MAC number into a database;
writing a sequence number: if the serial number and the MAC number are not repeated, the serial number writing software writes the serial number and the MAC number into the corresponding television, and if the serial number and the MAC number are repeated, the serial number and the MAC number are not written.
In other embodiments, the database query, data processing, server-side data determination steps, and XLS document writing operations are the same as those in the first embodiment, and are not described herein again.
The writing method of the serial number of the television can avoid repeated writing of the serial number and the MAC number between different televisions and different production lines, greatly reduces the later human input caused by repeated writing of the serial number and the MAC number, and simultaneously improves the processing efficiency.
The above description is only an embodiment of the present invention, and is not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims (6)
1. A method for judging whether a serial number is repeated, which is characterized by comprising the following steps:
data reception: the client receives a serial number and an MAC number to be judged;
database query: a client queries a database;
judging whether the data are repeated: after the database query is completed, the client judges whether the serial number and the MAC number are repeated;
data processing: if the serial number and the MAC number are judged to be repeated, the client writes the repeated serial number and the repeated MAC number into the XLS document; if the serial number and the MAC number are not repeated, the client writes the serial number and the MAC number into a database;
the database querying step comprises:
if the network is in a connection state, the client firstly queries the remote database, performs local database query after completing the remote database query, and executes the step of judging whether the data is repeated or not after completing the local database query;
if the network is in a disconnected state, only querying a local database, and after the query of the local database is completed, executing the step of judging whether the data is repeated;
the remote database query is carried out in a main thread, the local database query is carried out in a thread, before the remote data and the local data are judged to be repeated, the main thread is enabled to wait until the local database query is finished, after the query of the local database and the remote database is finished, the data are judged to be repeated together, and then the operation of a data repetition flag bit is carried out;
also comprises the following steps:
and (3) server data judgment: if the network is in a connection state, the client side sends the received serial number and the received MAC number to be judged to the server side, the server side receives the serial number and the MAC number, the server side inquires a remote database and a local database and judges whether the serial number and the MAC number are repeated, if so, the server side feeds back a judgment result to the client side, and the client side executes the database inquiry step; if not, the server side feeds back a judgment result to the client side, the serial number and the MAC number are written into a remote database and a local database, and the client side executes the database query step;
in the data judgment of the server, the client and the server carry out network communication through a TCP socket, and the server receives a serial number to be judged and an MAC number which are sent by the client in a TCP socket communication mode;
the writing of the database and the XLS document is carried out by two threads, and a lock mechanism is added.
2. The method of claim 1, wherein the data processing step comprises: a substep of setting a repeated flag bit and a substep of judging whether the data flag bit is repeated or not:
setting a repeated flag bit:
if the network is in a connection state and the serial number and the MAC number are judged to be repeated, the client sets a local repeated data flag bit and a remote repeated data flag bit, and then executes a substep of judging whether the data flag bits are repeated or not; if the serial number and the MAC number are not repeated, directly executing a substep of judging whether the data zone bit is repeated or not;
if the network is in a disconnected state and the serial number and the MAC number are judged to be repeated, the client sets a local repeated data flag bit, and then executes the substep of judging whether the data flag bit is repeated or not; if the serial number and the MAC number are not repeated, directly executing a substep of judging whether the data zone bit is repeated or not;
judging whether the data zone bit is repeated:
if the network is in a connection state, the client judges whether the remote data zone bit and the local data zone bit are repeated: if the serial number and the MAC number are repeated, the client writes the serial number and the MAC number into an XLS document; if not, the client writes the serial number and the MAC number into a remote database and a local database;
if the network is in a disconnected state, the client judges whether the local data zone bit is repeated: if the serial number and the MAC number are repeated, the client writes the serial number and the MAC number into an XLS document; and if not, the client writes the serial number and the MAC number into a local database.
3. The method as claimed in claim 1, wherein the step of the client sending the received serial number and MAC number to be determined to the server in the server data determination comprises the following sub-steps:
data format conversion: converting the obtained serial number and the MAC number into a character string format;
character string segmentation: dividing fields in the character string format by using '″ or t';
a sending field: sending each divided field;
the server side receives the serial number and the MAC number and comprises the following substeps:
receiving a field: receiving each field sent by a client;
storing fields and querying a database: storing each field into a tuple;
and then the server side inquires the remote database and the local database.
4. The method of any of claims 1-2, wherein writing duplicate serial and MAC numbers into an XLS document comprises:
reading the repeated serial number and the MAC number into a file stream;
acquiring a working table of XLS and an empty row which needs to be written into the working table of XLS;
writing the repeated serial number and the MAC number into the corresponding cell of the empty row;
the Flush file stream is closed.
5. The method of claim 1, wherein: the method also includes the steps of listening to the port: the server monitors the ports of the clients simultaneously, establishes communication connection with the clients respectively, receives the receiving serial numbers and the MAC numbers sent by the clients respectively, and then executes the server data judgment step.
6. A writing method of a serial number of a television is characterized by comprising the following steps:
transmission sequence number and MAC number: the serial number writing software respectively sends the serial number to be written and the MAC number to the client;
data reception: the client receives a serial number and an MAC number to be judged;
database query: a client queries a database;
judging whether the data are repeated: after the database query is completed, the client judges whether the serial number and the MAC number are repeated;
data processing: if the serial number and the MAC number are judged to be repeated, the client feeds back a judgment result to each serial number writing software, and writes the repeated serial number and the repeated MAC number into an XLS document; if the serial number and the MAC number are not repeated, the client feeds back a judgment result to each serial number writing software, and writes the serial number and the MAC number into a database;
the database querying step comprises:
if the network is in a connection state, the client firstly queries the remote database, performs local database query after completing the remote database query, and executes the step of judging whether the data is repeated or not after completing the local database query;
if the network is in a disconnected state, only inquiring the local database, and after finishing the inquiry of the local database, executing the step of judging whether the data is repeated;
remote database query is carried out in a main thread, local database query is carried out in a thread, the main thread waits until the query of the local database is finished before judging whether the remote data and the local data are repeated, after the query of the local database and the remote database is finished, whether the data are repeated is judged together, and then the operation of data repetition flag bits is carried out;
also comprises the following steps:
and (3) server data judgment: if the network is in a connection state, the client side sends the received serial number and the MAC number to be judged to the server side, the server side receives the serial number and the MAC number, the server side inquires a remote database and a local database and judges whether the serial number and the MAC number are repeated, if so, the server side feeds back a judgment result to the client side, and the client side executes the database inquiry step; if not, the server side feeds back a judgment result to the client side, the serial number and the MAC number are written into a remote database and a local database, and the client side executes the database query step;
in the data judgment of the server side, the client side and the server side carry out network communication through a TCP (transmission control protocol) socket, and the server side receives a serial number and an MAC (media access control) number to be judged, which are sent by the client side, in a TCP socket communication mode;
the writing of the database and the XLS document is carried out in two threads, and a lock mechanism is added;
writing a sequence number: if the serial number and the MAC number are not repeated, the serial number writing software writes the serial number and the MAC number into the corresponding television, and if the serial number and the MAC number are repeated, the serial number and the MAC number are not written.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610990914.6A CN108073592B (en) | 2016-11-10 | 2016-11-10 | Method for judging whether sequence number is repeated or not and method for writing in sequence number of television |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610990914.6A CN108073592B (en) | 2016-11-10 | 2016-11-10 | Method for judging whether sequence number is repeated or not and method for writing in sequence number of television |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108073592A CN108073592A (en) | 2018-05-25 |
CN108073592B true CN108073592B (en) | 2022-09-06 |
Family
ID=62154587
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610990914.6A Active CN108073592B (en) | 2016-11-10 | 2016-11-10 | Method for judging whether sequence number is repeated or not and method for writing in sequence number of television |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108073592B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112099454B (en) * | 2020-09-24 | 2022-08-30 | 富泰华精密电子(郑州)有限公司 | Control method, control device, and storage medium |
CN113014491B (en) * | 2021-02-26 | 2022-07-08 | 山东英信计算机技术有限公司 | A method and device for checking duplicate MAC addresses of servers |
CN112950236B (en) * | 2021-03-31 | 2023-05-23 | 四川虹美智能科技有限公司 | Sequence number writing method, device and computer readable medium |
CN113204468A (en) * | 2021-05-13 | 2021-08-03 | 山东英信计算机技术有限公司 | Method, system and storage medium for removing duplicate of server diagnosis information |
CN113836575A (en) * | 2021-08-18 | 2021-12-24 | 青岛中科英泰商用系统股份有限公司 | A device information writing control method and system thereof |
CN114338611A (en) * | 2021-12-30 | 2022-04-12 | 苏州易德龙科技股份有限公司 | Management and control method for avoiding MAC ID repetition |
CN114124904B (en) * | 2022-01-25 | 2022-05-24 | 北京智象信息技术有限公司 | Method and system for verifying MAC (media Access control) address by server side to be burned into multiple devices |
Family Cites Families (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101371254A (en) * | 2003-02-21 | 2009-02-18 | 索尼电子有限公司 | Media Content Identification |
US7483923B2 (en) * | 2003-08-21 | 2009-01-27 | Microsoft Corporation | Systems and methods for providing relational and hierarchical synchronization services for units of information manageable by a hardware/software interface system |
US7512969B2 (en) * | 2003-11-21 | 2009-03-31 | Time Warner Cable, A Division Of Time Warner Entertainment Company, L.P. | System and method for detecting and reporting cable network devices with duplicate media access control addresses |
CN1917540B (en) * | 2006-07-27 | 2011-09-14 | 中山大学 | Distribution type resource shared device and method in use for digital cells |
CN102377753B (en) * | 2010-08-19 | 2015-12-02 | 腾讯科技(深圳)有限公司 | System information recognition methods, device and system |
CN102081537B (en) * | 2010-12-31 | 2014-12-17 | 青岛海信宽带多媒体技术有限公司 | Method for upgrading software |
CN102521252A (en) * | 2011-11-17 | 2012-06-27 | 四川长虹电器股份有限公司 | Access method of remote data |
CN104111936B (en) * | 2013-04-18 | 2017-12-05 | 阿里巴巴集团控股有限公司 | Data query method and system |
CN103793485B (en) * | 2014-01-20 | 2017-07-11 | 锐达互动科技股份有限公司 | Client is based on the data cached method for realizing inquiry network data |
CN104156796A (en) * | 2014-06-23 | 2014-11-19 | 福建二菱电子有限公司 | Method and system for managing production line of MAC (Media Access Control) address on Internet set top box |
CN104461641B (en) * | 2014-12-15 | 2017-11-21 | 福州瑞芯微电子股份有限公司 | A kind of data programming method, system, burn writing equipment and target device |
CN105142024B (en) * | 2015-08-20 | 2019-05-10 | 深圳Tcl数字技术有限公司 | Method and device for burning TV data |
CN105407146B (en) * | 2015-10-27 | 2018-07-20 | 成都云卫康医疗科技有限公司 | It is a kind of from bracelet to APP again to the method for data synchronization of server |
CN105611408A (en) * | 2015-12-23 | 2016-05-25 | 深圳创维数字技术有限公司 | Set top box number writing method, set top box and set top box number writing server |
CN105763924B (en) * | 2016-01-29 | 2019-03-26 | 四川长虹电器股份有限公司 | Dual searching method based on Intelligent set top box application |
CN105871855B (en) * | 2016-04-11 | 2019-09-13 | 杨鹏 | The method and system that a kind of electronic equipment identification code is generated, stores and identified |
-
2016
- 2016-11-10 CN CN201610990914.6A patent/CN108073592B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108073592A (en) | 2018-05-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108073592B (en) | Method for judging whether sequence number is repeated or not and method for writing in sequence number of television | |
US8856349B2 (en) | Connection priority services for data communication between two devices | |
US9965213B2 (en) | IP hard disk and storage system, and data operation methods therefor | |
US20090191972A1 (en) | "Gaming Network" | |
CN108512930A (en) | Shared file management method, device, server and storage medium | |
DE112016002340B4 (en) | Using one network to bring a second network into operation | |
DE112016000587T5 (en) | INTEROPERABILITY OF DISCOVERY AND CONNECTION PROTOCOLS BETWEEN CLIENT DEVICES AND FIRST SCREEN DEVICES | |
CN110363979A (en) | A LoRa remote control system and control method based on ModBus protocol | |
CN102647470A (en) | Cloud download method in on-line application platform and on-line application platform system | |
CN111190960B (en) | A method, device, equipment and medium for distributed file transmission | |
CN106790182A (en) | Distributed service service system and its corresponding device of centralized services control method | |
CN101667139A (en) | Service program invocation method based on aggregate type object, device and system therefor | |
CN104468520A (en) | Identity authentication method and device | |
DE102008014982B4 (en) | Virtual network projection system supporting multiple projection sources, and methods thereof | |
CN109144989B (en) | Data cleaning method and device | |
CN107182073A (en) | One kind configuration equipment networking system and method | |
CN111083246A (en) | Data transmission processing method, Ethernet switch and storage medium | |
CN114678022A (en) | Voice control method and device for terminal device, storage medium and electronic device | |
CN111586081B (en) | Internet of things implementation method based on object model | |
CN113783902B (en) | Communication conversion method and device suitable for communication among different devices | |
CN106209836A (en) | A kind of data acquisition port expansion device, data collecting system and method | |
CN111881063A (en) | Multi-platform adaptive Internet of things module based on Flash cutting and control method thereof | |
CN115842869B (en) | Digital rural management method, device and control system based on Internet of things | |
CN108055331A (en) | A kind of method of smart mobile phone remotely controlling computer | |
CN111565209B (en) | Client instant messaging method, device, equipment and medium |
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 |