[go: up one dir, main page]

CN113656654B - Method, device and system for adding equipment - Google Patents

Method, device and system for adding equipment Download PDF

Info

Publication number
CN113656654B
CN113656654B CN202111212632.0A CN202111212632A CN113656654B CN 113656654 B CN113656654 B CN 113656654B CN 202111212632 A CN202111212632 A CN 202111212632A CN 113656654 B CN113656654 B CN 113656654B
Authority
CN
China
Prior art keywords
sub
data processing
mark
processing device
flag
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
Application number
CN202111212632.0A
Other languages
Chinese (zh)
Other versions
CN113656654A (en
Inventor
陈栋梁
马华章
于海波
张东胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yunding Network Technology Beijing Co Ltd
Original Assignee
Yunding Network Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yunding Network Technology Beijing Co Ltd filed Critical Yunding Network Technology Beijing Co Ltd
Priority to CN202111212632.0A priority Critical patent/CN113656654B/en
Publication of CN113656654A publication Critical patent/CN113656654A/en
Application granted granted Critical
Publication of CN113656654B publication Critical patent/CN113656654B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; Data structures therefor; Storage structures hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90348Query processing by searching ordered data, e.g. alpha-numerically ordered data

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)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a method, a device and a system for adding equipment, wherein a specific implementation mode of the method comprises the following steps: the server acquires a first mark corresponding to the data processing device based on a sub-device list synchronization request sent by the data processing device; comparing the first mark with a second mark in the synchronous request of the sub-equipment list, and if the first mark is inconsistent with the second mark, generating a corresponding sub-equipment list file; calculating a third mark of the data processing device according to each sub-device identification code in the sub-device list file; sending a sub-device synchronization request to the data processing device, and enabling the data processing device to add sub-devices corresponding to the identification codes of the sub-devices based on the sub-device synchronization request; and when the synchronization completion information sent by the data processing device is received, storing a fourth mark in the synchronization completion information into the database. This embodiment enables a reduction of the time to add a plurality of sub-devices to the data processing apparatus.

Description

Method, device and system for adding equipment
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method, an apparatus, and a system for adding devices.
Background
With the development of internet technology, a user can add a sub-device to a network organized by a data processing apparatus network, so that the data processing apparatus can perform data communication with the sub-device after recognizing the sub-device.
However, in the above-mentioned data processing apparatus sub-device adding method, if a plurality of sub-devices are added to the data processing apparatus at the same time, they need to be added one by one, and the whole adding process takes a long time.
Disclosure of Invention
In view of the above, the present application provides a method, an apparatus, and a system for adding devices, so as to solve the problem in the prior art that it takes a long time to add multiple sub-devices to a data processing apparatus.
In a first aspect, an embodiment of the present application provides a method for device addition, which is applied to a server, and the method includes:
receiving a sub-device list synchronization request sent by a data processing device, and acquiring a first mark corresponding to the data processing device based on the sub-device list synchronization request, wherein the sub-device list synchronization request carries a second mark of the data processing device;
comparing the first marker to the second marker;
if the first mark is inconsistent with the second mark, generating a sub-device list file related to the data processing device, wherein the sub-device list file comprises a plurality of sub-device identification codes, and the sub-devices corresponding to the sub-device identification codes are associated with the data processing device;
calculating a third mark of the data processing device according to each sub-device identification code in the sub-device list file;
sending a sub-device synchronization request to the data processing device so that the data processing device adds the sub-devices corresponding to the sub-device identification codes based on the sub-device synchronization request; the sub-device synchronization request carries the third flag and the file identifier of the sub-device list file;
receiving synchronization completion information sent by the data processing device, and storing a fourth mark in the synchronization completion information into a database; and the fourth mark is obtained by the data processing device through calculation according to each sub-device identification code in the sub-device list file.
In some embodiments, the generating a child device list file associated with the data processing apparatus if the first flag and the second flag are inconsistent includes:
acquiring sub-equipment identification codes corresponding to sub-equipment which are in incidence relation with the data processing device from a database;
and generating a sub-device list file related to the data processing device according to each sub-device identification code.
In some embodiments, said calculating a third flag of said data processing apparatus according to each said sub-device identification code in said sub-device list file comprises:
sequencing the identification codes of the sub-equipment in the sub-equipment list file according to a preset rule to obtain a first identification code array;
splicing the identification codes of the sub-devices in the first identification code data to generate a first character string;
splicing the first character string and a preset secret key to generate a second character string;
and processing the second character string through a preset algorithm to obtain a third mark of the data processing device.
In some embodiments, after receiving the synchronization completion information sent by the data processing apparatus and storing the fourth flag in the synchronization completion information in the database, the method further includes:
and sending a data acquisition request of the sub-equipment to the data processing device so that the data processing device acquires the data of the sub-equipment indicated by the data acquisition request of the sub-equipment and feeds back corresponding data to the server.
In some embodiments, after receiving the synchronization completion information sent by the data processing apparatus and storing the fourth flag in the synchronization completion information in the database, the method further includes:
and sending a sub-device control request to the data processing device so that the data processing device performs corresponding operation on the sub-device indicated by the sub-device control request.
In a second aspect, an embodiment of the present application provides a method for device addition, which is applied to a data processing apparatus, and the method includes:
sending a sub-device list synchronization request to a server, wherein the sub-device list synchronization request carries a second mark of the data processing device;
when a sub-device synchronization request sent by the server is received, acquiring a corresponding sub-device list file from the server according to the file identifier of the sub-device list file in the sub-device synchronization request; the sub-device synchronization request carries a third mark and a file identifier of the sub-device list file;
calculating a fourth mark of the data processing device according to each sub-device identification code in the sub-device list file;
comparing the third marker to the fourth marker;
and if the third mark is consistent with the fourth mark, adding corresponding sub-equipment according to the identification code of the sub-equipment, and sending synchronization completion information to the server.
In some embodiments, before sending the child device list synchronization request to the server, the method includes:
detecting the current time of the data processing device in real time;
and when the current time of the data processing device reaches the preset synchronization time, the step of sending a sub-device list synchronization request to the server is executed.
In some embodiments, said calculating a fourth flag of said data processing apparatus according to each said sub device identification code in said sub device list file comprises:
sequencing the identification codes of the sub-equipment in the sub-equipment list file according to a preset rule to obtain a second identification code array;
splicing the identification codes of the sub-devices in the second identification code array to generate a third character string;
splicing the third character string and a preset secret key to generate a fourth character string;
and processing the fourth character string through a preset algorithm to obtain a fourth mark of the data processing device.
In some embodiments, the method further comprises:
and when a data acquisition request of the sub-equipment sent by the server is received, acquiring the data of the sub-equipment indicated by the data acquisition request of the sub-equipment, and feeding back corresponding data to the server.
In some embodiments, the method further comprises:
and when a sub-device control request sent by the server is received, performing corresponding operation on the sub-device indicated by the sub-device control request according to the sub-device control request.
In a third aspect, an embodiment of the present application provides an apparatus for device addition, which is applied to a server, and the apparatus includes:
a first mark obtaining unit, configured to receive a sub device list synchronization request sent by a data processing apparatus, and obtain a first mark corresponding to the data processing apparatus based on the sub device list synchronization request, where the sub device list synchronization request carries a second mark of the data processing apparatus;
the first comparison unit is used for comparing the first mark with the second mark;
a sub-device list file generating unit, configured to generate a sub-device list file related to the data processing apparatus if the first flag and the second flag are inconsistent, where the sub-device list file includes a plurality of sub-device identification codes, and a sub-device corresponding to the sub-device identification code has an association relationship with the data processing apparatus;
a third flag calculating unit, configured to calculate a third flag of the data processing apparatus according to each of the child device identification codes in the child device list file;
a sub-device synchronization request sending unit, configured to send a sub-device synchronization request to the data processing apparatus, so that the data processing apparatus adds the sub-devices corresponding to the respective sub-device identification codes based on the sub-device synchronization request; the sub-device synchronization request carries the third flag and the file identifier of the sub-device list file;
the storage unit is used for receiving the synchronization completion information sent by the data processing device and storing the fourth mark in the synchronization completion information into the database; and the fourth mark is obtained by the data processing device through calculation according to each sub-device identification code in the sub-device list file.
In a fourth aspect, an embodiment of the present application provides an apparatus for device addition, which is applied to a data processing apparatus, and the apparatus includes:
a sub-device list synchronization request sending unit, configured to send a sub-device list synchronization request to a server, where the sub-device list synchronization request carries a second flag of the data processing apparatus;
the sub-device list file acquisition unit is used for acquiring a corresponding sub-device list file from the server according to the file identifier of the sub-device list file in the sub-device synchronization request when receiving the sub-device synchronization request sent by the server; the sub-device synchronization request carries a third mark and a file identifier of the sub-device list file;
a fourth flag calculating unit, configured to calculate a fourth flag of the data processing apparatus according to each of the child device identification codes in the child device list file;
a second comparison unit, configured to compare the third flag with the fourth flag;
and the sub-device adding unit is used for adding corresponding sub-devices according to the identification codes of the sub-devices and sending synchronization completion information to the server if the third mark is consistent with the fourth mark.
In a fifth aspect, an embodiment of the present application provides a system for device addition, where the system for device addition includes: the system comprises a server, a data processing device and a plurality of sub-devices;
the server is used for receiving a sub-device list synchronization request sent by a data processing device and acquiring a first mark corresponding to the data processing device based on the sub-device list synchronization request; comparing the first mark with a second mark of the data processing device in the sub-device list synchronization request; if the first mark is inconsistent with the second mark, generating a sub-equipment list file related to the data processing device; calculating a third mark of the data processing device according to each sub-device identification code in the sub-device list file; sending a sub-device synchronization request to the data processing apparatus; and the system is used for storing a fourth mark in the synchronization completion information to the database when the synchronization completion information sent by the data processing device is received; the data processing device comprises a data processing device and a sub-device identification code, wherein the sub-device corresponding to each sub-device identification code is associated with the data processing device; the sub-device synchronization request carries the third flag and the file identifier of the sub-device list file;
the data processing device is used for acquiring the sub-device list file from the service based on the file identifier of the sub-device list file when receiving a sub-device synchronization request sent by the server; calculating a fourth mark of the data processing device according to each sub-device identification code in the sub-device list file, comparing the third mark with the fourth mark, if the third mark is consistent with the fourth mark, adding each corresponding sub-device according to each sub-device identification code, and sending synchronization completion information to the server; wherein the synchronization completion information includes the fourth flag.
The application provides a method, a device and a system for adding equipment, wherein a data processing device sends a sub-equipment list synchronization request to a server, the server acquires a first mark corresponding to the data processing device based on the received sub-equipment list synchronization request, compares the first mark with a second mark in the sub-equipment list synchronization request, generates a sub-equipment list file related to the data processing device if the first mark is inconsistent with the second mark, calculates a third mark of the data processing device according to each sub-equipment identification code in the sub-equipment list file, and sends a sub-equipment synchronization request carrying the third mark and the file identification of the sub-equipment list file to the data processing device; the data processing device acquires the sub-device list file from the server according to the file identification of the sub-device list file in the sub-device synchronization request, calculates a fourth mark of the data processing device according to the identification codes of the sub-devices in the sub-device list file so as to compare the third mark with the fourth mark, and under the condition that the third mark is consistent with the fourth mark, the data processing device adds corresponding sub-devices according to the identification codes of the sub-devices and sends synchronization completion information carrying the fourth mark to the server so that the server stores the fourth mark in the synchronization completion information to a database and informs the server that the sub-devices corresponding to the identification codes of the sub-devices in the sub-device file list are successfully added to the data processing device. According to the technical scheme, when a plurality of pieces of sub-equipment are required to be added into the data processing device, the server can generate a corresponding sub-equipment list file according to the sub-equipment identification codes corresponding to the plurality of pieces of sub-equipment required to be added under the condition that the sub-equipment list synchronization request sent by the data processing device is received and the second mark of the data processing device in the sub-equipment list synchronization request is inconsistent with the first mark of the data processing device in the server, so that the data processing device can simultaneously add the plurality of corresponding sub-equipment through the generated sub-equipment list file, and the situation that the sub-equipment is added into the data processing device one by one like the prior art is avoided, and the time for adding the sub-equipment into the data processing device is greatly reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application 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 examples or embodiments of the present application, and that for a person skilled in the art, other drawings can be obtained from the provided drawings without inventive effort, and that the present application can also be applied to other similar scenarios from the provided drawings. Unless otherwise apparent from the context, or otherwise indicated, like reference numbers in the figures refer to the same structure or operation.
FIG. 1 is an architecture diagram of one embodiment of a system for device addition according to the present application;
FIG. 2 is a schematic flow chart diagram illustrating one embodiment of a method for device addition according to the present application;
FIG. 3 is a schematic flow chart diagram of yet another embodiment of a method for device addition according to the present application;
FIG. 4 is a schematic flow chart diagram of yet another embodiment of a method for device addition according to the present application;
FIG. 5 is a schematic block diagram of one embodiment of an apparatus for device addition according to the present application;
fig. 6 is a schematic structural diagram of a device for equipment addition according to another embodiment of the application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. The described embodiments are only some embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be understood that "system", "apparatus", "unit" and/or "module" as used herein is a method for distinguishing different components, elements, parts or assemblies at different levels. However, other words may be substituted by other expressions if they accomplish the same purpose.
As used in this application and the appended claims, the terms "a," "an," "the," and/or "the" are not intended to be inclusive in the singular, but rather are intended to be inclusive in the plural unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that steps and elements are included which are explicitly identified, that the steps and elements do not form an exclusive list, and that a method or apparatus may include other steps or elements. An element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, and may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
Flow charts are used herein to illustrate operations performed by systems according to embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed in the exact order in which they are performed. Rather, the various steps may be processed in reverse order or simultaneously. Meanwhile, other operations may be added to or removed from these processes.
Referring to fig. 1, an architecture diagram of a system for device addition provided by an embodiment of the present application is shown, where the system for device addition includes a server, a data processing apparatus, and at least a plurality of sub devices.
The server is used for receiving the sub-equipment list synchronization request sent by the data processing device and acquiring a first mark corresponding to the data processing device based on the sub-equipment list synchronization request; comparing the first mark with a second mark of the data processing device in the synchronous request of the sub-device list; if the first mark is inconsistent with the second mark, generating a sub-equipment list file related to the data processing device; calculating a third mark of the data processing device according to each sub-device identification code in the sub-device list file; sending a sub-equipment synchronization request to the data processing apparatus; and the fourth mark in the synchronization completion information is stored in the database when the synchronization completion information sent by the data processing device is received; the data processing device comprises a data processing device and a plurality of sub-devices, wherein the sub-devices corresponding to the identification codes of the sub-devices are associated with the data processing device; and the child device synchronization request carries the third mark and the file identifier of the child device list file.
The data processing device is used for acquiring the sub-equipment list file from the cloud service based on the file identification of the sub-equipment list file when receiving a sub-equipment synchronization request sent by the server; calculating a fourth mark of the data processing device according to the identification codes of the sub-devices in the sub-device list file, comparing the third mark with the fourth mark, if the third mark is consistent with the fourth mark, adding the corresponding sub-devices according to the identification codes of the sub-devices, and sending synchronization completion information to the cloud server; wherein the synchronization completion information includes a fourth flag.
Further, the server is further configured to, when receiving synchronization completion information sent by the data processing apparatus, after storing a fourth flag in the synchronization completion information in the database, send a data acquisition request of the sub-device to the data processing apparatus, so that the data processing apparatus acquires data of the sub-device indicated by the data acquisition request of the sub-device, and feed back corresponding data to the server; and sending the sub-device control request to the data processing device so that the data processing device performs corresponding operation on the sub-device indicated by the sub-device control request.
Correspondingly, the data processing device is also used for acquiring the data of the sub-equipment indicated by the sub-equipment data acquisition request and feeding back the corresponding data to the server when the sub-equipment data acquisition request sent by the server is received; and when receiving the sub-equipment control request sent by the server, carrying out corresponding operation on the sub-equipment indicated by the sub-equipment control request according to the sub-equipment control request.
Referring to fig. 2, a schematic flow chart of a method for device addition provided in an embodiment of the present application is shown, where the method for device addition is applied to the system for device addition shown in fig. 1, where a sub-device in the system for device addition is a meter, a data processing apparatus is a meter data processing apparatus, and the following description is made by taking the sub-device as a meter and the data processing apparatus as a meter data processing apparatus for parsing, where the method for device addition specifically includes the following steps:
s201: the meter data processing apparatus sends a child device list synchronization request to the server.
In the embodiment of the application, the preset synchronization time for sending the sub-device list synchronization request to the server can be set in the meter data processing device in advance, and then the meter data processing device can detect the current time of the meter data processing device in real time, and when the current time is detected to reach the preset synchronization time, the sub-device list synchronization request can be sent to the server. Wherein the meter data processing device may be a gateway.
It should be noted that the identifier of the meter data processing device is carried in the child device list synchronization request, and for convenience of distinction, the identifier of the meter data processing device carried in the child device list synchronization request may be referred to as a second identifier.
It should also be noted that the identifier of the meter data processing device carried in the kid device list synchronization request may be a hash value of the meter data processing device, a timestamp, a version number of the meter data processing device, or the like.
S202: the server receives a sub-device list synchronization request sent by the meter data processing device, and acquires a first mark corresponding to the meter data processing device based on the sub-device list synchronization request.
In this application embodiment, if a user wants to add a corresponding new add sub-device to a meter data processing device, the association relationship between the meter data processing device and a meter to be added can be entered into a database of a server, and when the server receives the association relationship entered by the user, the server will store the received association relationship into the database after clearing the mark of the meter data processing device, which is stored in the database in advance.
In the embodiment of the present application, the identifier of the meter data processing device originally stored in the database may be a hash value, a timestamp, a version number of the meter data processing device, or the like.
It should be noted that the meter can be an intelligent water meter, an intelligent electric meter, a gas meter, an intelligent lock, and the like. When the strapping table is the water gauge, the strapping table data processing device can be a water gauge collector.
In the specific execution of step S202, upon receiving a sub-device list synchronization request from a meter data processing apparatus, the flag corresponding to the meter data processing device may be retrieved from the database in accordance with the kid device list synchronization request (for ease of distinction, the flag corresponding to the meter data processing device retrieved from the database may be referred to as the first flag), if the database stores the incidence relation between the newly added meter and the meter data processing device, the first flag stored in the meter data processing device in the database is 0, and when the first flag is compared with the second flag, it can be determined that the first flag and the second flag are not identical, a sub-device list file associated with the meter data processing apparatus may then be generated to add the corresponding meter to the meter data processing apparatus based on the generated sub-device list file.
If the incidence relation between the newly added meter input by the user and the meter data processing device is not stored in the database, the first mark stored in the meter data processing device in the database is not changed, at the moment, the first mark and the second mark are compared, the first mark and the second mark can be determined to be consistent, and further the meter corresponding to the meter data processing device in synchronization can not be needed.
Correspondingly, when receiving the sub-device list synchronization request sent by the meter data processing device, the server can acquire the first mark of the meter data processing device from the database through the meter data processing device according to the sub-device list synchronization request.
Further, in this application embodiment, if a user wants to delete a corresponding meter in the meter data processing device, the association relationship between the meter data processing device and the meter may be entered into the database of the server, and when receiving the association relationship entered by the user, the server will store the received association relationship into the database after clearing the mark of the meter data processing device, which is stored in the database in advance.
Correspondingly, when the server receives a sub-device list synchronization request sent by the meter data processing device, the server can acquire a first mark corresponding to the meter data processing device from the database according to the sub-device list synchronization request, if the incidence relation between the meter to be deleted and the meter data processing device, which is input by a user, is stored in the database, the first mark stored in the meter data processing device in the database is 0, at this time, the first mark and the second mark are compared, the first mark and the second mark can be determined to be inconsistent, and then a sub-device list file related to the meter data processing device can be generated, so that the corresponding meter can be deleted in the meter data processing device according to the generated sub-device list file.
It should be noted that the meter can send a corresponding registration command to the server by relying on a communication link of a website, after the registration is successful, a user can poll the registration state of the meter through the client, and if the registration state of the meter is determined to be the registration completion, a binding request can be sent to the meter, so that the association relationship between the meter and the client is established in the database.
S203: the server compares the first mark with the second mark; if the first flag and the second flag are not consistent, step S204 is executed.
In the process of specifically executing step S203, after the server obtains the second flag corresponding to the meter data processing apparatus from the database according to the received sub-device list synchronization request, the server may compare the first flag with the second flag, and if the first flag is consistent with the second flag, it may be determined that the database does not store the association relationship between the newly added meter entered by the user and the meter data processing apparatus, and then the corresponding meter may not be synchronized with the meter data processing apparatus.
If the first mark and the second mark are inconsistent, the incidence relation between the newly added meter recorded by the user and the meter data processing device stored in the database can be determined, and then a sub-device list file related to the meter data processing device can be generated, so that the corresponding meter is added to the meter data processing device according to the generated sub-device list file.
S204: the server generates a child device list file associated with the meter data processing apparatus.
The sub-device list file comprises a plurality of sub-device identification codes, and the sub-device corresponding to each sub-device identification code is associated with the meter data processing device.
In the specific process of step S204, when it is determined that the first flag and the second flag are inconsistent, the server may obtain the sub-device identification codes sn of the meters associated with the meter data processing apparatus from the database, and further may generate a sub-device list file related to the meter data processing apparatus according to the obtained sub-device identification codes sn.
It should be noted that the sub-device identification code of a meter may be a sub-device serial number of the meter.
It should also be noted that the meter's sub-device serial number is a unique identification code data.
S205: and the server calculates a third mark of the meter data processing device according to each sub-device identification code in the sub-device list file.
In the specific process of step S205, after generating the sub-device list file related to the meter data processing apparatus, the server may sort the identification codes of the sub-devices in the sub-device list file according to a preset rule, so as to obtain a first identification code array sn _ arr 1; splicing the identification codes of the sub-devices in the first identification code data to generate a first character string str 1; splicing the first character string str1 with a preset secret key secret to generate a second character string str 2; and processing the second string str2 according to a preset algorithm to obtain a third mark of the meter data processing device.
In this embodiment of the application, the preset rule may be sorting according to an alphabetical order, that is, sorting the identifiers of the respective sub-devices in the sub-device list file according to the alphabetical order to obtain the first identifier array sn _ arr 1.
In this embodiment of the application, the preset algorithm may be a hash algorithm, and correspondingly, the hash operation may be performed on the second string str2 according to the hash algorithm to obtain a hash value of the data processing apparatus, that is, to obtain the third flag of the data processing apparatus.
S206: the server sends a child sub-device synchronization request to the meter data processing apparatus.
And the child device synchronization request comprises the file identification and the third mark of the child device list file.
In the specific process of step S206, after calculating the third flag of the meter data processing apparatus according to the identification codes of the sub-devices in the sub-device list file, the server may generate a corresponding sub-device synchronization request according to the generated third flag and the generated file identification of the sub-device list file, and send the generated sub-device synchronization request to the meter data processing apparatus.
S207: and the meter data processing device acquires the sub-device list file from the server according to the file identifier in the sub-device synchronization request.
In the specific process of step S207, after receiving the sub-device synchronization request sent by the server, the meter data processing apparatus may obtain, according to the file identifier in the sub-device synchronization request, the sub-device list file corresponding to the file identifier file from the server.
S208: and the meter data processing device calculates a fourth mark of the meter data processing device according to the identification codes of the sub-devices in the sub-device list file.
In the specific process of executing step S208, after obtaining the corresponding child device list file according to the file identifier in the child device synchronization request, the meter data processing apparatus may sort the child device identifiers in the child device list file according to a preset rule, so as to obtain a second identifier array sn _ arr 2; splicing the identification codes of the sub-devices in the second identification code array to generate a third character string str 3; and splicing the third character string str3 with a preset secret key secret to generate a fourth character string str4, and processing the fourth character string str4 according to a preset algorithm to obtain a fourth mark of the data processing device.
In this embodiment of the application, the preset rule may be sorting according to an alphabetical order, that is, sorting the identifiers of the respective sub-devices in the sub-device list file according to the alphabetical order to obtain the second identifier array sn _ arr 2.
In this embodiment of the application, the preset algorithm may be a hash algorithm, and correspondingly, the hash operation may be performed on the third character string str3 according to the hash algorithm to obtain a hash value of the data processing apparatus, that is, to obtain the fourth flag of the data processing apparatus.
S209: the meter data processing device compares the third mark with the fourth mark; if the third flag and the fourth flag are consistent, step S210 is executed.
In the specific process of step S209, after calculating the fourth flag of the meter data processing apparatus according to the identifier of each sub-device in the sub-device list file, the meter data processing apparatus may compare the calculated fourth flag with the third flag in the sub-device synchronization request, and if the third flag is identical to the fourth flag, step S210 is performed.
It should be noted that, if the third flag and the fourth flag are inconsistent, the data processing apparatus may return to detect the self-time in real time, and when it is detected that the self-time of the meter data processing apparatus reaches the preset synchronization time, the sub-device list synchronization request is sent to the server again.
S210: and the meter data processing device adds corresponding meters according to the identification codes of the sub-devices and sends synchronization completion information carrying the fourth mark to the server.
In the specific implementation of step S210, if the third flag and the fourth flag are identical, the meter data processing apparatus may add corresponding meters according to the identification codes of the sub-devices in the sub-device list file, generate corresponding synchronization completion information, and send the generated synchronization completion information to the server, so as to notify the server that the meters corresponding to the identification codes of the sub-devices in the sub-device file list have been successfully added to the meter data processing apparatus.
S211: and the server receives the synchronization completion information sent by the meter data processing device and stores a fourth mark in the synchronization completion information into the database.
In the specific implementation of step S211, the server stores the fourth flag in the synchronization completion information to the database after receiving the synchronization completion information sent by the meter data processing apparatus.
S212: and the server sends a data acquisition request of the sub-equipment to the meter data processing device.
In the specific process of step S212, after receiving the synchronization completion information sent by the meter data processing apparatus, the server may send a sub-device data collection request to the meter data processing apparatus.
It should be noted that the slave device control request carries the meter that wants to collect data.
S213: the meter data processing device collects the data of the sub-equipment indicated by the sub-equipment data collection request and feeds back corresponding data to the server.
In the specific process of step S213, when receiving the sub-device data acquisition request sent by the server, the meter data processing apparatus acquires the data of the sub-device indicated by the sub-device data acquisition request, and feeds back the corresponding data to the server.
S214: the server sends a sub-device control request to the meter data processing apparatus.
In the specific implementation of step S214, the server may send a corresponding sub-device control request to the meter data processing apparatus after receiving the synchronization completion information sent by the meter data processing apparatus.
It should be noted that the sub-device control request carries the meter to be controlled and the corresponding control instruction. The control instruction can be used for controlling the valve of the corresponding meter to be opened or controlling the valve of the corresponding meter to be closed.
S215: and the meter data processing device carries out corresponding operation on the sub-equipment indicated by the sub-equipment control request according to the sub-equipment control request.
In the specific process of step S215, when receiving the sub-device control request sent by the server, the meter data processing apparatus performs corresponding operation on the sub-device indicated by the sub-device control request according to the sub-device control request.
The application provides a method for adding equipment, a data processing device sends a sub-equipment list synchronization request to a server, the server obtains a first mark corresponding to the data processing device based on the received sub-equipment list synchronization request, compares the first mark with a second mark in the sub-equipment list synchronization request, generates a sub-equipment list file related to the data processing device if the first mark is inconsistent with the second mark, calculates a third mark of the data processing device according to each sub-equipment identification code in the sub-equipment list file, and sends a sub-equipment synchronization request carrying the third mark and the file identification of the sub-equipment list file to the data processing device; the data processing device acquires the sub-device list file from the server according to the file identification of the sub-device list file in the sub-device synchronization request, calculates a fourth mark of the data processing device according to the identification codes of the sub-devices in the sub-device list file so as to compare the third mark with the fourth mark, and under the condition that the third mark is consistent with the fourth mark, the data processing device adds corresponding sub-devices according to the identification codes of the sub-devices and sends synchronization completion information carrying the fourth mark to the server so that the server stores the fourth mark in the synchronization completion information to a database and informs the server that the sub-devices corresponding to the identification codes of the sub-devices in the sub-device file list are successfully added to the data processing device. According to the technical scheme, when a plurality of pieces of sub-equipment are required to be added into the data processing device, the server can generate a corresponding sub-equipment list file according to the sub-equipment identification codes corresponding to the plurality of pieces of sub-equipment required to be added under the condition that the sub-equipment list synchronization request sent by the data processing device is received and the second mark of the data processing device in the sub-equipment list synchronization request is inconsistent with the first mark of the data processing device in the server, so that the data processing device can simultaneously add the plurality of corresponding sub-equipment through the generated sub-equipment list file, and the situation that the sub-equipment is added into the data processing device one by one like the prior art is avoided, and the time for adding the sub-equipment into the data processing device is greatly reduced.
The method for device addition provided by the embodiments of the present application is described below from the perspective of a server and a meter data processing apparatus, respectively.
Referring to fig. 3, a flowchart of a method for device addition provided in an embodiment of the present application is shown, where the method for device addition is applicable to a server, and specifically includes the following steps:
s301: receiving a sub-device list synchronization request sent by the meter data processing device, and acquiring a first mark corresponding to the meter data processing device based on the sub-device list synchronization request, wherein the sub-device list synchronization request carries a second mark of the meter data processing device.
In the embodiment of the application, the preset synchronization time for sending the sub-device list synchronization request to the server can be set in the meter data processing device in advance, and then the meter data processing device can detect the current time of the meter data processing device in real time, and when the current time is detected to reach the preset synchronization time, the sub-device list synchronization request can be sent to the server. Wherein the meter data processing device may be a gateway.
It should be noted that the identifier of the meter data processing device is carried in the child device list synchronization request, and for convenience of distinction, the identifier of the meter data processing device carried in the child device list synchronization request may be referred to as a second identifier.
It should also be noted that the identifier of the meter data processing device carried in the kid device list synchronization request may be a hash value of the meter data processing device, a timestamp, a version number of the meter data processing device, or the like.
In the specific execution of step S302, upon receiving a sub-device list synchronization request transmitted by the meter data processing apparatus, the flag corresponding to the meter data processing device may be retrieved from the database in accordance with the kid device list synchronization request (for ease of distinction, the flag corresponding to the meter data processing device retrieved from the database may be referred to as the first flag), if the database stores the incidence relation between the newly added meter and the meter data processing device, the first flag stored in the meter data processing device in the database is 0, and when the first flag is compared with the second flag, it can be determined that the first flag and the second flag are not identical, a sub-device list file associated with the meter data processing apparatus may then be generated to add the corresponding meter to the meter data processing apparatus based on the generated sub-device list file.
If the incidence relation between the newly added meter input by the user and the meter data processing device is not stored in the database, the first mark stored in the meter data processing device in the database is not changed, at the moment, the first mark and the second mark are compared, the first mark and the second mark can be determined to be consistent, and further the meter corresponding to the meter data processing device in synchronization can not be needed.
Correspondingly, when receiving the sub-device list synchronization request sent by the meter data processing device, the server can acquire the first mark of the meter data processing device from the database through the meter data processing device according to the sub-device list synchronization request.
Further, in this application embodiment, if a user wants to delete a corresponding meter in the meter data processing device, the association relationship between the meter data processing device and the meter may be entered into the database of the server, and when receiving the association relationship entered by the user, the server will store the received association relationship into the database after clearing the mark of the meter data processing device, which is stored in the database in advance.
Correspondingly, when the server receives a sub-device list synchronization request sent by the meter data processing device, the server can acquire a first mark corresponding to the meter data processing device from the database according to the sub-device list synchronization request, if the incidence relation between the meter to be deleted and the meter data processing device, which is input by a user, is stored in the database, the first mark stored in the meter data processing device in the database is 0, at this time, the first mark and the second mark are compared, the first mark and the second mark can be determined to be inconsistent, and then a sub-device list file related to the meter data processing device can be generated, so that the corresponding meter can be deleted in the meter data processing device according to the generated sub-device list file.
S302: comparing the first marker with the second marker; if the first flag and the second flag are not consistent, step S303 is executed.
S303: a child device list file associated with the meter data processing apparatus is generated.
S304: and calculating a third mark of the meter data processing device according to the identification codes of the sub-devices in the sub-device list file.
In the process of specifically executing step S302 to step S304, the specific execution process and implementation principle of step S302 to step S304 are the same as the specific execution process and implementation principle of step S203 to step S205 in fig. 2 disclosed in the present application, and reference may be made to corresponding parts in fig. 2 disclosed in the present application, which is not described herein again.
S305: and sending a sub-device synchronization request to the meter data processing device so that the meter data processing device adds the meters corresponding to the identification codes of the sub-devices based on the sub-device synchronization request.
And the child device synchronization request comprises the file identification and the third mark of the child device list file.
In the specific implementation of step S305, after calculating the third flag of the meter data processing apparatus according to the identification codes of the sub-devices in the sub-device list file, the server may generate a corresponding sub-device synchronization request according to the generated third flag and the generated file identification of the sub-device list file, and send the generated sub-device synchronization request to the meter data processing apparatus.
In this embodiment, after receiving a sub-device synchronization request sent by a server, a meter data processing apparatus may obtain, from the server, a sub-device list file corresponding to a sub-device identification file according to a file identification in the sub-device synchronization request.
Sorting the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a second identification code array sn _ arr 2; splicing the identification codes of the sub-devices in the second identification code array to generate a third character string str 3; and splicing the third character string str3 with a preset secret key secret to generate a fourth character string str4, and processing the fourth character string str4 according to a preset algorithm to obtain a fourth mark of the data processing device.
And comparing the calculated fourth mark with the third mark in the sub-device synchronization request, if the third mark is consistent with the fourth mark, adding corresponding meters according to the identification codes of the sub-devices in the sub-device list file, generating corresponding synchronization completion information, and sending the generated synchronization completion information to the server so as to inform the server that the meters corresponding to the identification codes of the sub-devices in the sub-device file list are successfully added in the meter data processing device.
In this embodiment of the application, the preset rule may be sorting according to an alphabetical order, that is, sorting the identifiers of the respective sub-devices in the sub-device list file according to the alphabetical order to obtain the second identifier array sn _ arr 2.
In this application embodiment, preset algorithm may be hash algorithm, and correspondingly, hash operation may be performed on third character string str3 according to hash algorithm, so as to obtain a hash value of the meter data processing apparatus, that is, obtain the fourth flag of the meter data processing apparatus.
S306: and when receiving the synchronization completion information sent by the meter data processing device, storing a fourth mark in the synchronization completion information into the database.
In the specific process of step S306, after receiving the synchronization completion information sent by the meter data processing apparatus, the server stores the fourth flag in the synchronization completion information in the database.
S307: and sending a data acquisition request of the sub-equipment to the meter data processing device so that the data processing device acquires the data of the sub-equipment indicated by the data acquisition request of the sub-equipment and feeds back corresponding data to the server.
S308: and sending a sub-device control request to the meter data processing device so that the data processing device performs corresponding operation on the sub-device indicated by the sub-device control request.
In the process of specifically executing step S307 to step S308, the specific execution process and implementation principle of step S307 to step S308 are the same as the specific execution process and implementation principle of step S212 to step S215 in fig. 2 disclosed in the present application, and reference may be made to corresponding parts in fig. 2 disclosed in the present application, which is not described herein again.
The application provides a method for adding equipment, when a plurality of pieces of sub-equipment need to be added in a data processing device or an old data processing device fails and needs to be replaced, a sub-equipment list synchronization request can be sent to a server through the data processing device or a new data processing device after replacement; the server may generate a corresponding sub-device list file according to the sub-device identification codes corresponding to the plurality of sub-devices that need to be added, so that the data processing apparatus may simultaneously add the corresponding plurality of sub-devices through the generated sub-device list file, unlike the prior art, in which one sub-device is added to the data processing apparatus, thereby greatly reducing the time for adding the sub-devices to the data processing apparatus.
Referring to fig. 4, a flow chart of a method for device addition provided by the embodiment of the present application is shown, where the method for device addition is applied to a meter data processing apparatus, and specifically includes the following steps:
s401: and sending a sub-device list synchronization request to the server, wherein the sub-device list synchronization request carries a second mark of the meter data processing device.
In the embodiment of the application, the preset synchronization time for sending the sub-device list synchronization request to the server can be set in the meter data processing device in advance, and then the meter data processing device can detect the current time of the meter data processing device in real time, and when the current time is detected to reach the preset synchronization time, the sub-device list synchronization request can be sent to the server. Wherein the meter data processing device may be a gateway.
It should be noted that the identifier of the meter data processing device is carried in the child device list synchronization request, and for convenience of distinction, the identifier of the meter data processing device carried in the child device list synchronization request may be referred to as a second identifier.
It should also be noted that the identifier of the meter data processing device carried in the kid device list synchronization request may be a hash value of the meter data processing device, a timestamp, a version number of the meter data processing device, or the like.
In the embodiment of the present application, upon receiving a child device list synchronization request sent by a meter data processing apparatus, the flag corresponding to the meter data processing device may be retrieved from the database in accordance with the kid device list synchronization request (for ease of distinction, the flag corresponding to the meter data processing device retrieved from the database may be referred to as the first flag), if the database stores the incidence relation between the newly added meter and the meter data processing device, the first flag stored in the meter data processing device in the database is 0, and when the first flag is compared with the second flag, it can be determined that the first flag and the second flag are not identical, a sub-device list file associated with the meter data processing apparatus may then be generated to add the corresponding meter to the meter data processing apparatus based on the generated sub-device list file.
Sorting the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a first identification code array sn _ arr 1; splicing the identification codes of the sub-devices in the first identification code data to generate a first character string str 1; splicing the first character string str1 with a preset secret key secret to generate a second character string str 2; and processing the second string str2 according to a preset algorithm to obtain a third mark of the meter data processing device.
And generating a corresponding sub-device synchronization request according to the generated third mark and the file identifier of the generated sub-device list file, and sending the generated sub-device synchronization request to the meter data processing device.
In this embodiment, the preset rule may be sorting according to an alphabetical order, that is, sorting the identifiers of the sub-devices in the sub-device list file according to the alphabetical order, so as to obtain the first identifier array sn _ arr 1.
In this embodiment of the application, the preset algorithm may be a hash algorithm, and correspondingly, the hash operation may be performed on the second string str2 according to the hash algorithm to obtain a hash value of the data processing apparatus, that is, to obtain the third flag of the data processing apparatus.
It should be noted that the sub-device identification code of a meter may be a sub-device serial number of the meter.
It should also be noted that the meter's sub-device serial number is a unique identification code data.
S402: and when a sub-device synchronization request sent by the server is received, acquiring a corresponding sub-device list file from the server according to the file identifier of the sub-device list file in the sub-device synchronization request.
S403: and calculating a fourth mark of the meter data processing device according to the identification codes of the sub-devices in the sub-device list file.
S404: comparing the third marker with the fourth marker; if the third flag and the fourth flag are consistent, step S405 is executed.
S405: and adding corresponding meters according to the identification codes of the sub-devices, and sending synchronization completion information to the server so that the server stores the fourth mark in the synchronization completion information to the database.
S406: and when receiving a data acquisition request of the sub-equipment sent by the server, acquiring the data of the sub-equipment indicated by the data acquisition request of the sub-equipment, and feeding back corresponding data to the server.
S407: and when receiving the sub-equipment control request sent by the server, carrying out corresponding operation on the sub-equipment indicated by the sub-equipment control request according to the sub-equipment control request.
In the process of specifically executing step S402 to step S407, the specific execution process and implementation principle of step S402 to step S407 are the same as the specific execution process and implementation principle of step S207 to step S215 in fig. 2 disclosed in the present application, and reference may be made to corresponding parts in fig. 2 disclosed in the present application, which is not described herein again.
The application provides a method for adding equipment, a sub-equipment list synchronization request can be sent to a server through a data processing device, the server can generate a corresponding sub-equipment list file according to sub-equipment identification codes corresponding to a plurality of sub-equipment needing to be added under the condition that the sub-equipment list synchronization request sent by the data processing device is received, and a second mark of the data processing device in the sub-equipment list synchronization request is inconsistent with a first mark of the data processing device in the server, so that the data processing device can simultaneously add the corresponding plurality of sub-equipment through the generated sub-equipment list file, and the sub-equipment is not added into the data processing device one by one like the prior art, thereby greatly reducing the time for adding the sub-equipment into the data processing device.
Corresponding to the method for device addition disclosed in the embodiment of the present application, as shown in fig. 5, an embodiment of the present application further provides a schematic structural diagram of an apparatus for device addition, where the apparatus for device addition includes:
a first flag acquiring unit 51, configured to receive a sub device list synchronization request sent by a data processing apparatus, and acquire a first flag corresponding to the data processing apparatus based on the sub device list synchronization request, where the sub device list synchronization request carries a second flag of the data processing apparatus;
a first comparison unit 52, configured to compare the first flag with the second flag;
a sub-device list file generating unit 53, configured to generate a sub-device list file related to the data processing apparatus if the first flag and the second flag are inconsistent, where the sub-device list file includes a plurality of sub-device identification codes, and a sub-device corresponding to the sub-device identification code has an association relationship with the data processing apparatus;
a third flag calculating unit 54 for calculating a third flag of the data processing apparatus based on the identification codes of the respective sub devices in the sub device list file;
a sub-device synchronization request sending unit 55, configured to send a sub-device synchronization request to the data processing apparatus, so that the data processing apparatus adds sub-devices corresponding to the respective sub-device identification codes based on the sub-device synchronization request; the sub-device synchronization request carries a third mark and a file identifier of the sub-device list file;
the storage unit 56 is used for receiving the synchronization completion information sent by the data processing device and storing a fourth mark in the synchronization completion information into the database; and the fourth mark is obtained by the data processing device through calculation according to the identification codes of the sub-devices in the sub-device list file.
The specific principle and the implementation process of each unit in the apparatus for device addition disclosed in the embodiment of the present application are the same as those of the method for device addition disclosed in fig. 3 in the embodiment of the present application, and reference may be made to corresponding parts in the method for device addition disclosed in fig. 3 in the embodiment of the present application, which are not described herein again.
The application provides a method for adding equipment, when a plurality of pieces of sub-equipment need to be added in a data processing device or an old data processing device fails and needs to be replaced, a sub-equipment list synchronization request can be sent to a server through the data processing device or a new data processing device after replacement; the server may generate a corresponding sub-device list file according to the sub-device identification codes corresponding to the plurality of sub-devices that need to be added, so that the data processing apparatus may simultaneously add the corresponding plurality of sub-devices through the generated sub-device list file, unlike the prior art, in which one sub-device is added to the data processing apparatus, thereby greatly reducing the time for adding the sub-devices to the data processing apparatus.
Optionally, the sub-device list file generating unit includes:
the data processing device comprises a sub-device identification code acquisition unit, a data processing unit and a data processing unit, wherein the sub-device identification code acquisition unit is used for acquiring sub-device identification codes corresponding to sub-devices which are in association with the data processing device from a database;
and the sub-device list file generating sub-unit is used for generating a sub-device list file related to the data processing device according to each sub-device identification code.
Optionally, the third flag calculating unit includes:
the first sequencing unit is used for sequencing the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a first identification code array;
the first character string generation unit is used for splicing the identification codes of the sub-devices in the first identification code data to generate a first character string;
the second character string generating unit is used for splicing the first character string and a preset secret key to generate a second character string;
and the first operation unit is used for processing the second character string through a preset algorithm to obtain a third mark of the data processing device.
Further, the apparatus for adding device provided by the present application further includes:
and the data processing device is used for acquiring the data of the sub-equipment indicated by the data acquisition request of the sub-equipment and feeding back the corresponding data to the server.
Further, the apparatus for adding device provided by the present application further includes:
and the sub-device control request sending unit is used for sending the sub-device control request to the data processing device so that the data processing device carries out corresponding operation on the sub-device indicated by the sub-device control request.
Corresponding to the method for device addition disclosed in the embodiment of the present application, as shown in fig. 6, an embodiment of the present application further provides a schematic structural diagram of another apparatus for device addition, where the apparatus for device addition includes:
a sub-device list synchronization request sending unit 61, configured to send a sub-device list synchronization request to the server, where the sub-device list synchronization request carries a second flag of the data processing apparatus;
a sub-device list file obtaining unit 62, configured to, when receiving a sub-device synchronization request sent by a server, obtain a corresponding sub-device list file from the server according to a file identifier of the sub-device list file in the sub-device synchronization request; the sub-device synchronization request carries a third mark and a file identifier of the sub-device list file;
a fourth flag calculating unit 63, configured to calculate a fourth flag of the data processing apparatus according to each of the child device identification codes in the child device list file;
a second comparing unit 64, configured to compare the third flag with the fourth flag;
and the sub-device adding unit 65 is configured to add, if the third flag is consistent with the fourth flag, corresponding sub-devices according to the identification codes of the sub-devices, and send synchronization completion information to the server, so that the server stores the fourth flag in the synchronization completion information in the database.
The specific principle and the implementation process of each unit in the apparatus for device addition disclosed in the embodiment of the present application are the same as those of the method for device addition disclosed in fig. 4 in the embodiment of the present application, and reference may be made to corresponding parts in the method for device addition disclosed in fig. 4 in the embodiment of the present application, which are not described herein again.
The application provides a method for adding equipment, a sub-equipment list synchronization request can be sent to a server through a data processing device, the server can generate a corresponding sub-equipment list file according to sub-equipment identification codes corresponding to a plurality of sub-equipment needing to be added under the condition that the sub-equipment list synchronization request sent by the data processing device is received, and a second mark of the data processing device in the sub-equipment list synchronization request is inconsistent with a first mark of the data processing device in the server, so that the data processing device can simultaneously add the corresponding plurality of sub-equipment through the generated sub-equipment list file, and the sub-equipment is not added into the data processing device one by one like the prior art, thereby greatly reducing the time for adding the sub-equipment into the data processing device.
Further, the apparatus for adding device provided by the present application further includes:
the real-time detection unit is used for detecting the current time of the data processing device in real time;
and the execution unit is used for executing the sub-equipment list synchronization request sending unit when the current time of the data processing device reaches the preset synchronization time.
Optionally, the fourth flag calculating unit includes:
the second sorting unit is used for sorting the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a second identification code array;
the third character string generating unit is used for splicing the identification codes of the sub-devices in the second identification code array to generate a third character string;
the fourth character string unit is used for splicing the third character string and the preset secret key to generate a fourth character string;
and the second operation unit is used for processing the fourth character string through a preset algorithm to obtain a fourth mark of the data processing device.
Further, the apparatus for adding device provided by the present application further includes:
and the data acquisition unit is used for acquiring the data of the sub-equipment indicated by the sub-equipment data acquisition request and feeding back corresponding data to the server when receiving the sub-equipment data acquisition request sent by the server.
Further, the apparatus for adding device provided by the present application further includes:
and the control unit is used for carrying out corresponding operation on the sub-equipment indicated by the sub-equipment control request according to the sub-equipment control request when receiving the sub-equipment control request sent by the server.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are merely illustrative, wherein units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (11)

1. A method for device addition, applied to a server, the method comprising:
receiving a sub-device list synchronization request sent by a data processing device, and acquiring a first mark corresponding to the data processing device based on the sub-device list synchronization request, wherein the sub-device list synchronization request carries a second mark of the data processing device;
comparing the first marker to the second marker;
if the first mark is inconsistent with the second mark, generating a sub-device list file related to the data processing device, wherein the sub-device list file comprises a plurality of sub-device identification codes, and the sub-devices corresponding to the sub-device identification codes are associated with the data processing device;
calculating a third mark of the data processing device according to each sub-device identification code in the sub-device list file;
sending a sub-device synchronization request to the data processing device so that the data processing device adds the sub-devices corresponding to the sub-device identification codes based on the sub-device synchronization request; the sub-device synchronization request carries the third flag and the file identifier of the sub-device list file;
receiving synchronization completion information sent by the data processing device, and storing a fourth mark in the synchronization completion information into a database; the fourth mark is obtained by the data processing device through calculation according to each sub-device identification code in the sub-device list file;
wherein the obtaining of the first flag corresponding to the data processing apparatus based on the child device list synchronization request includes:
recording the incidence relation between the data processing device and the meter to be added into a database of a server;
when the input incidence relation is received, clearing the mark of the data processing device, which is stored in the database in advance, and storing the received incidence relation into the database;
the calculating a third flag of the data processing apparatus according to each of the child device identification codes in the child device list file includes:
sorting the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a first identification code array;
splicing the identification codes of all the sub-devices in the first identification code array to generate a first character string;
splicing the first character string and a preset secret key to generate a second character string;
and processing the second character string according to a preset algorithm to obtain a third mark of the data processing device.
2. The method of claim 1, wherein generating a child device list file associated with the data processing apparatus if the first flag and the second flag are inconsistent comprises:
acquiring sub-equipment identification codes corresponding to sub-equipment which are in incidence relation with the data processing device from a database;
and generating a sub-equipment list file related to the data processing device according to each sub-equipment identification code.
3. The method according to claim 1, wherein after receiving the synchronization completion information sent by the data processing apparatus and storing the fourth flag in the synchronization completion information in a database, the method further comprises:
and sending a data acquisition request of the sub-equipment to the data processing device so that the data processing device acquires the data of the sub-equipment indicated by the data acquisition request of the sub-equipment and feeds back corresponding data to the server.
4. The method according to claim 1, wherein after receiving the synchronization completion information sent by the data processing apparatus and storing the fourth flag in the synchronization completion information in a database, the method further comprises:
and sending a sub-device control request to the data processing device so that the data processing device performs corresponding operation on the sub-device indicated by the sub-device control request.
5. A method for device addition, applied to a data processing apparatus, the method comprising:
sending a sub-device list synchronization request to a server, wherein the sub-device list synchronization request carries a second mark of the data processing device;
when a sub-device synchronization request sent by the server is received, acquiring a corresponding sub-device list file from the server according to the file identifier of the sub-device list file in the sub-device synchronization request; the sub-device synchronization request carries a third mark and a file identifier of the sub-device list file;
calculating a fourth mark of the data processing device according to each sub-device identification code in the sub-device list file;
comparing the third marker to the fourth marker;
if the third mark is consistent with the fourth mark, corresponding sub-equipment is added according to the identification code of the sub-equipment, and synchronization completion information is sent to the server;
wherein the calculating a fourth flag of the data processing apparatus according to the identification codes of the respective sub-devices in the sub-device list file includes:
sorting the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a second identification code array;
splicing the identification codes of all the sub-devices in the second identification code array to generate a third character string;
splicing the third character string and a preset secret key to generate a fourth character string;
and processing the fourth character string according to a preset algorithm to obtain a fourth mark of the data processing device.
6. The method of claim 5, wherein before sending the request for synchronization of the list of child devices to the server, the method comprises:
detecting the current time of the data processing device in real time;
and when the current time of the data processing device reaches the preset synchronization time, the step of sending a sub-device list synchronization request to the server is executed.
7. The method of claim 5, further comprising:
and when a data acquisition request of the sub-equipment sent by the server is received, acquiring the data of the sub-equipment indicated by the data acquisition request of the sub-equipment, and feeding back corresponding data to the server.
8. The method of claim 5, further comprising:
and when a sub-device control request sent by the server is received, performing corresponding operation on the sub-device indicated by the sub-device control request according to the sub-device control request.
9. An apparatus for device addition, applied to a server, the apparatus comprising:
a first flag obtaining unit, configured to receive a sub device list synchronization request sent by a data processing apparatus, and obtain a first flag corresponding to the data processing apparatus based on the sub device list synchronization request, where the sub device list synchronization request carries a second flag of the data processing apparatus, and the obtaining of the first flag corresponding to the data processing apparatus based on the sub device list synchronization request includes: recording the incidence relation between the data processing device and the meter to be added into a database of a server; when the input incidence relation is received, clearing the mark of the data processing device, which is stored in the database in advance, and storing the received incidence relation into the database;
the first comparison unit is used for comparing the first mark with the second mark;
a sub-device list file generating unit, configured to generate a sub-device list file related to the data processing apparatus if the first flag and the second flag are inconsistent, where the sub-device list file includes a plurality of sub-device identification codes, and a sub-device corresponding to the sub-device identification code has an association relationship with the data processing apparatus;
a third flag calculating unit, configured to calculate a third flag of the data processing apparatus according to each of the sub-device identification codes in the sub-device list file, where the calculating the third flag of the data processing apparatus according to each of the sub-device identification codes in the sub-device list file includes: sorting the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a first identification code array; splicing the identification codes of all the sub-devices in the first identification code array to generate a first character string; splicing the first character string and a preset secret key to generate a second character string; processing the second character string according to a preset algorithm to obtain a third mark of the data processing device;
a sub-device synchronization request sending unit, configured to send a sub-device synchronization request to the data processing apparatus, so that the data processing apparatus adds the sub-devices corresponding to the respective sub-device identification codes based on the sub-device synchronization request; the sub-device synchronization request carries the third flag and the file identifier of the sub-device list file;
the storage unit is used for receiving the synchronization completion information sent by the data processing device and storing a fourth mark in the synchronization completion information into a database; and the fourth mark is obtained by the data processing device through calculation according to each sub-device identification code in the sub-device list file.
10. An apparatus for device addition, applied to a data processing apparatus, the apparatus comprising:
a sub-device list synchronization request sending unit, configured to send a sub-device list synchronization request to a server, where the sub-device list synchronization request carries a second flag of the data processing apparatus;
the sub-device list file acquisition unit is used for acquiring a corresponding sub-device list file from the server according to the file identifier of the sub-device list file in the sub-device synchronization request when receiving the sub-device synchronization request sent by the server; the sub-device synchronization request carries a third mark and a file identifier of the sub-device list file;
a fourth flag calculating unit, configured to calculate a fourth flag of the data processing apparatus according to each of the sub-device identification codes in the sub-device list file, where the calculating the fourth flag of the data processing apparatus according to each of the sub-device identification codes in the sub-device list file includes: sorting the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a second identification code array; splicing the identification codes of all the sub-devices in the second identification code array to generate a third character string; splicing the third character string and a preset secret key to generate a fourth character string; processing the fourth character string according to a preset algorithm to obtain a fourth mark of the data processing device;
a second comparison unit, configured to compare the third flag with the fourth flag;
and the sub-equipment adding unit is used for adding corresponding sub-equipment according to the identification code of each sub-equipment if the third mark is consistent with the fourth mark, and sending synchronization completion information to the server.
11. A system for device addition, the system for device addition comprising: the system comprises a server, a data processing device and a plurality of sub-devices;
the server is used for receiving a sub-device list synchronization request sent by a data processing device and acquiring a first mark corresponding to the data processing device based on the sub-device list synchronization request; comparing the first mark with a second mark of the data processing device in the sub-device list synchronization request; if the first mark is inconsistent with the second mark, generating a sub-equipment list file related to the data processing device; calculating a third mark of the data processing device according to each sub-device identification code in the sub-device list file; sending a sub-device synchronization request to the data processing apparatus; and the system is used for storing a fourth mark in the synchronization completion information to a database when the synchronization completion information sent by the data processing device is received; the data processing device comprises a data processing device and a sub-device identification code, wherein the sub-device corresponding to each sub-device identification code is associated with the data processing device; the sub-device list synchronization request carries the third flag and the file identifier of the sub-device list file, and the acquiring the first flag corresponding to the data processing apparatus based on the sub-device list synchronization request includes: recording the incidence relation between the data processing device and the meter to be added into a database of a server; when the input incidence relation is received, clearing the mark of the data processing device, which is stored in the database in advance, and storing the received incidence relation into the database; the calculating a third flag of the data processing apparatus according to each of the child device identification codes in the child device list file includes: sequencing the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a first identification code array; splicing the identification codes of all the sub-devices in the first identification code array to generate a first character string; splicing the first character string and a preset secret key to generate a second character string; processing the second character string according to a preset algorithm to obtain a third mark of the data processing device;
the data processing device is used for acquiring the sub-device list file from the server based on the file identifier of the sub-device list file when receiving a sub-device synchronization request sent by the server; calculating a fourth mark of the data processing device according to each sub-device identification code in the sub-device list file, comparing the third mark with the fourth mark, if the third mark is consistent with the fourth mark, adding each corresponding sub-device according to each sub-device identification code, and sending synchronization completion information to the server; wherein the synchronization completion information includes the fourth flag, and the calculating the fourth flag of the data processing apparatus according to the identification codes of the respective sub devices in the sub device list file includes: sorting the identification codes of the sub-devices in the sub-device list file according to a preset rule to obtain a second identification code array; splicing the identification codes of all the sub-devices in the second identification code array to generate a third character string; splicing the third character string and a preset secret key to generate a fourth character string; and processing the fourth character string according to a preset algorithm to obtain a fourth mark of the data processing device.
CN202111212632.0A 2021-10-19 2021-10-19 Method, device and system for adding equipment Active CN113656654B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111212632.0A CN113656654B (en) 2021-10-19 2021-10-19 Method, device and system for adding equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111212632.0A CN113656654B (en) 2021-10-19 2021-10-19 Method, device and system for adding equipment

Publications (2)

Publication Number Publication Date
CN113656654A CN113656654A (en) 2021-11-16
CN113656654B true CN113656654B (en) 2022-05-10

Family

ID=78484211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111212632.0A Active CN113656654B (en) 2021-10-19 2021-10-19 Method, device and system for adding equipment

Country Status (1)

Country Link
CN (1) CN113656654B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771556A (en) * 2008-12-11 2010-07-07 华为终端有限公司 Method for realizing DM device association as well as system and device therefor
CN111382192A (en) * 2018-12-28 2020-07-07 北京神州泰岳软件股份有限公司 Data list display method and device and electronic equipment
CN113342750A (en) * 2021-06-29 2021-09-03 深圳前海微众银行股份有限公司 File data comparison method, device, equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9866586B2 (en) * 2014-04-30 2018-01-09 Twitter, Inc. Facilitating cross-platform content access
CN107347025A (en) * 2017-06-14 2017-11-14 云丁网络技术(北京)有限公司 Data processing method, device, server and system
CN108364371B (en) * 2018-02-11 2020-12-22 中广核核电运营有限公司 Device management method, device, system, computer device and storage medium
WO2020024106A1 (en) * 2018-07-31 2020-02-06 深圳市大疆创新科技有限公司 File browsing method, electronic device and machine readable storage medium
CN111325877B (en) * 2018-12-14 2021-09-28 云丁网络技术(北京)有限公司 Electronic equipment control method and device and electronic equipment
CN112486105B (en) * 2019-09-12 2022-05-13 深圳市云海物联科技有限公司 Equipment control method and device
CN112988458B (en) * 2019-12-18 2023-04-07 中国移动通信集团四川有限公司 Data backup method and device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771556A (en) * 2008-12-11 2010-07-07 华为终端有限公司 Method for realizing DM device association as well as system and device therefor
CN111382192A (en) * 2018-12-28 2020-07-07 北京神州泰岳软件股份有限公司 Data list display method and device and electronic equipment
CN113342750A (en) * 2021-06-29 2021-09-03 深圳前海微众银行股份有限公司 File data comparison method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113656654A (en) 2021-11-16

Similar Documents

Publication Publication Date Title
CN109981279B (en) Block chain system, communication method, device, equipment and medium
CN111831682B (en) Method, apparatus, device and computer readable medium for processing accumulation fund service
CN104348859B (en) File synchronisation method, device, server, terminal and system
CN109451078B (en) Transaction processing method and device under distributed architecture
CN107748790B (en) Online service system, data loading method, device and equipment
CN113360376A (en) Buried point testing method and device
CN110493302A (en) A kind of document transmission method, equipment and computer readable storage medium
CN112822260A (en) File transmission method and device, electronic equipment and storage medium
CN107704604A (en) A kind of information persistence method, server and computer-readable recording medium
CN111506358A (en) Method and device for updating container configuration
CN114238255A (en) Method, apparatus, electronic device, and computer-readable storage medium for synchronizing files
CN113691600A (en) Synchronization method and device of equipment state information and computer readable storage medium
CN113656654B (en) Method, device and system for adding equipment
CN110619022A (en) Node detection method, device, equipment and storage medium based on block chain network
CN112765010A (en) Method, device, equipment and storage medium for centralized management of service parameters
CN117493671A (en) Information processing method, information processing device, electronic equipment and computer storage medium
CN109005246A (en) A kind of synchronous method of data, apparatus and system
CN113468508B (en) Information verification method, device, server and storage medium
CN116743553A (en) Mirror image testing method and device
CN109961320A (en) One kind is based on computer network exploitation operation suggestion feedback collection system
CN211630177U (en) Equipment data acquisition system
CN112532458B (en) Cooperative configuration method and device for Internet of things equipment and electronic equipment
CN116028444B (en) File fingerprint generation method, device and system, electronic equipment and storage medium
CN115955500B (en) Network tracing method, device, terminal and medium
CN111639280A (en) Information sharing method and 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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100094 room 1101, 11 / F, building 1, zone 2, 81 Beiqing Road, Haidian District, Beijing

Patentee after: Yunding Network Technology (Beijing) Co.,Ltd.

Address before: 100094 room 1101, 11 / F, building 1, zone 2, 81 Beiqing Road, Haidian District, Beijing

Patentee before: YUN DING NETWORK TECHNOLOGY (BEIJING) Co.,Ltd.