CN112600946B - Method and device for determining equipment codes, storage medium and electronic device - Google Patents

Method and device for determining equipment codes, storage medium and electronic device Download PDF

Info

Publication number
CN112600946B
CN112600946B CN202011380164.3A CN202011380164A CN112600946B CN 112600946 B CN112600946 B CN 112600946B CN 202011380164 A CN202011380164 A CN 202011380164A CN 112600946 B CN112600946 B CN 112600946B
Authority
CN
China
Prior art keywords
coding
target
encoding
equipment
code
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
CN202011380164.3A
Other languages
Chinese (zh)
Other versions
CN112600946A (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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202011380164.3A priority Critical patent/CN112600946B/en
Publication of CN112600946A publication Critical patent/CN112600946A/en
Application granted granted Critical
Publication of CN112600946B publication Critical patent/CN112600946B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames
    • H04L61/3015Name registration, generation or assignment

Abstract

The application provides a method and a device for determining equipment codes, a storage medium and an electronic device, wherein the method comprises the following steps: the encoding processor receives an encoding request sent by a target object, wherein the encoding request is used for acquiring an equipment code of target equipment; the coding processor responds to the coding request and acquires coding information preset by the target object to the target equipment; the encoding processor determines the device encoding of the target device according to the encoding information, that is, the encoding processor realizes the conversion flow of the rapid encoding after the target object sends the encoding request, so that the problems of low encoding efficiency, high maintenance cost and the like of the target device in the prior art can be solved, the high efficiency of the encoding of the target device is ensured, and the maintenance cost of the encoding of the device is reduced.

Description

Method and device for determining equipment codes, storage medium and electronic device
Technical Field
The present application relates to the field of communications, and in particular, to a method and apparatus for determining a device code, a storage medium, and an electronic apparatus.
Background
In the platform of the Internet of things, in order to facilitate the development of work, such as subscription information, APP page function pulling and the like, equipment types are required to be encoded, but the existing equipment encoding adopts manual maintenance, background operation and maintenance personnel determine corresponding encoding settings according to industrial planning, and create response data, and the conditions of high operation and maintenance cost, high encoding error rate, complex operation flow and the like exist when encoding rules are changed,
therefore, a method capable of rapid encoding is required, and encoding needs to satisfy the following conditions: 1) The service logic is clear, so that a user can conveniently distinguish different equipment classifications from the coding region; 2) The classified coding algorithm has clear logic and is convenient for code maintenance.
Aiming at the problems of low coding efficiency, high maintenance cost and the like of target equipment in the related technology, an effective technical scheme has not been proposed yet.
Disclosure of Invention
The embodiment of the application provides a method and a device for determining equipment codes, a storage medium and an electronic device, which at least solve the problems of low coding efficiency, high maintenance cost and the like of target equipment in the related technology.
According to an embodiment of the present application, there is provided a method for determining device encoding, including: the encoding processor receives an encoding request sent by a target object, wherein the encoding request is used for acquiring an equipment code of target equipment; the coding processor responds to the coding request and acquires coding information preset by the target object for the target device; the encoding processor determines a device encoding of the target device based on the encoding information.
In one exemplary embodiment, an encoding processor receives an encoding request sent by a target object, comprising: receiving an encoding request created in a target platform by a target object, wherein the encoding request comprises at least one of the following: the device type of the target device, and the description information of the target device.
In an exemplary embodiment, obtaining the preset coding information of the target object for the target device includes: acquiring a plurality of pieces of coding information preset by the target object for a plurality of pieces of equipment under the condition that the coding information comprises a coding sequence and a coding rule, wherein the coding sequence is used for indicating the corresponding character string content coded by the equipment, and the coding rule is used for indicating N coding areas corresponding to the equipment coding and equipment types corresponding to the N coding areas respectively; and acquiring the coding information of the target equipment from the plurality of coding information.
In an exemplary embodiment, before the encoding processor determines the device encoding of the target device according to the encoding information, the method further includes: acquiring the equipment code with the target length, and dividing the equipment code with the target length into N coding regions, wherein N is a positive integer greater than 1; n device types corresponding to the N coding regions respectively are determined, wherein the N device types at least comprise one of the following: device class, device model; and determining the coding rule according to the determined N coding regions and N device types corresponding to the N coding regions.
In an exemplary embodiment, the encoding processor determines a device encoding of the target device from the encoding information, including: acquiring target coding regions in N coding regions of a plurality of equipment codes, wherein the plurality of equipment codes are stored in a database; determining whether the target coding region has reached a maximum coding; if yes, carrying out equipment coding again for the target equipment; and if not, sequentially determining the device codes of the target device according to the coding information and the device codes.
In an exemplary embodiment, the encoding processor determines a device encoding of the target device from the encoding information, including: initializing the encoding processor and loading the obtained encoding information of the target device; the encoding processor determines a device encoding of the target device based on the encoding information of the target device.
According to another embodiment of the present application, there is provided a device code determining apparatus including: the receiving module is used for receiving an encoding request sent by a target object, wherein the encoding request is used for acquiring equipment encoding of target equipment; the response module is used for responding to the coding request and acquiring coding information preset by the target object for the target equipment; and the determining module is used for determining the device code of the target device according to the code information.
In an exemplary embodiment, the receiving module is further configured to receive an encoding request created by the target object in the target platform, where the encoding request includes at least one of: the device type of the target device, and the description information of the target device.
In an exemplary embodiment, the obtaining module is further configured to obtain, when the encoding information includes an encoding sequence and an encoding rule, a plurality of encoding information preset by the target object for a plurality of devices, where the encoding sequence is used to indicate that the device encodes corresponding string content, and the encoding rule is used to indicate N encoding regions corresponding to the device encoding, and device types corresponding to the N encoding regions respectively; and acquiring the coding information of the target equipment from the plurality of coding information.
In an exemplary embodiment, the above apparatus further includes: the dividing module is used for acquiring the equipment codes with the target length and dividing the equipment codes with the target length into N coding regions, wherein N is a positive integer greater than 1; n device types corresponding to the N coding regions respectively are determined, wherein the N device types at least comprise one of the following: device class, device model; and determining the coding rule according to the determined N coding regions and N device types corresponding to the N coding regions.
In an exemplary embodiment, the obtaining module is further configured to obtain a target coding region from N coding regions of a plurality of device codes, where the plurality of device codes are stored in a database; determining whether the target coding region has reached a maximum coding; if yes, carrying out equipment coding again for the target equipment; and if not, sequentially determining the device codes of the target device according to the coding information and the device codes.
In an exemplary embodiment, the determining module is further configured to initialize the encoding processor, and load the obtained encoding information of the target device; the encoding processor determines a device encoding of the target device based on the encoding information of the target device.
According to a further embodiment of the application, there is also provided a storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the application, the encoding processor receives the encoding request sent by the target object, wherein the encoding request is used for acquiring the equipment code of the target equipment; the coding processor responds to the coding request and acquires coding information preset by the target object for the target device; the encoding processor determines the equipment encoding of the target equipment according to the encoding information, that is, the encoding processor realizes the conversion flow of the rapid encoding after the target object sends the encoding request, so that the problems of low encoding efficiency, high maintenance cost and the like of the target equipment in the prior art can be solved, the high efficiency of the encoding of the target equipment is ensured, and the maintenance cost of the encoding of the equipment is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a hardware block diagram of a device terminal of a device code determining method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of determining device encoding according to an embodiment of the application;
FIG. 3 is a call timing diagram of an ordered Tree Set system according to an alternative embodiment of the application;
FIG. 4 is a flow chart of applying for device type encoding in accordance with an alternative embodiment of the present application;
fig. 5 is a block diagram of a configuration of a device code determining apparatus according to an embodiment of the present application.
Detailed Description
The application will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiment provided by the embodiment of the application can be executed in a mobile terminal or a computing device similar to a computer terminal. Taking the operation on the device terminal as an example, fig. 1 is a block diagram of a hardware structure of the device terminal of a method for determining device codes according to an embodiment of the present application. As shown in fig. 1, the device terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and in one exemplary embodiment, the device terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the device terminals described above. For example, the device terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than the equivalent functions shown in fig. 1 or more than the functions shown in fig. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for determining device codes in an embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-described method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located with respect to the processor 102, which may be connected to the device terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. The specific example of the network described above may include a wireless network provided by a communication provider of the device terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In this embodiment, a method for determining a device code is provided, and fig. 2 is a flowchart of a method for determining a device code according to an embodiment of the present application, where the flowchart includes the following steps:
step S202, an encoding processor receives an encoding request sent by a target object, wherein the encoding request is used for acquiring an equipment code of target equipment;
step S204, the coding processor responds to the coding request and acquires coding information preset by the target object for the target device;
in step S206, the encoding processor determines the device encoding of the target device according to the encoding information.
Through the steps, the encoding processor receives an encoding request sent by a target object, wherein the encoding request is used for acquiring equipment codes of target equipment; the coding processor responds to the coding request and acquires coding information preset by the target object for the target device; the encoding processor determines the equipment encoding of the target equipment according to the encoding information, that is, the encoding processor realizes the conversion flow of the rapid encoding after the target object sends the encoding request, so that the problems of low encoding efficiency, high maintenance cost and the like of the target equipment in the prior art can be solved, the high efficiency of the encoding of the target equipment is ensured, and the maintenance cost of the encoding of the equipment is reduced.
The implementation manner of the step S202 is various, and in an alternative embodiment, the implementation manner may be as follows: receiving an encoding request created in a target platform by a target object, wherein the encoding request comprises at least one of the following: the device type of the target device, and the description information of the target device.
That is, when the target object creates the code request for generating the target device, the device type of the target device and the description information of the target device need to be determined, for example, the target object creates the code request for generating the refrigerator in the target platform, where the code request may include information indicating that the refrigerator is double-door, energy-saving, environment-adaptive, etc., for expressing the device type of the refrigerator, and may further include information such as 092 model, low power, etc., for more accurately expressing the description information of the target device, so that the generated device code may be more accurate.
In an exemplary embodiment, obtaining the preset coding information of the target object for the target device includes: acquiring a plurality of pieces of coding information preset by the target object for a plurality of pieces of equipment under the condition that the coding information comprises a coding sequence and a coding rule, wherein the coding sequence is used for indicating the corresponding character string content coded by the equipment, and the coding rule is used for indicating N coding areas corresponding to the equipment coding and equipment types corresponding to the N coding areas respectively; and acquiring the coding information of the target equipment from the plurality of coding information.
In short, in order to improve the coding efficiency, the determination of the coding is quickened by acquiring preset coding information, and the preset coding information further comprises a coding sequence for indicating the corresponding character string content of the equipment coding and coding rules for indicating a plurality of coding areas of the equipment type of the equipment; in order to enable the equipment codes to contain more information, the content of the character strings corresponding to the equipment codes is diversified, loading of target character strings can be carried out according to the needs, and the coding sequence is edited again according to words; furthermore, since the target device can have multiple device type features at the same time, the device type features can be divided into a large class of coding features, a medium class of coding features and a small class of coding features according to the applicable range of the device type features, and the coding features are correspondingly stored in the corresponding coding regions.
In an exemplary embodiment, before the encoding processor determines the device encoding of the target device according to the encoding information, the method further includes: acquiring the equipment code with the target length, and dividing the equipment code with the target length into N coding regions, wherein N is a positive integer greater than 1; n device types corresponding to the N coding regions respectively are determined, wherein the N device types at least comprise one of the following: device class, device model; and determining the coding rule according to the determined N coding regions and N device types corresponding to the N coding regions.
For example, when the target device is an energy-saving double-door refrigerator, the first N characters of the coding sequence may be defined as letters, the last N characters may be numbers, and the numbers or the coding interval positions may be modified according to coding information preset by the target object, so as to obtain a letter G representing the model of the energy-saving device, 2C representing the model of the double-door refrigerator, 02 representing the model of the double-door refrigerator, 1 representing the type of the device, assuming that the target length of the device code at this time is 8 bits, 3 coding regions exist, the first coding region contains the 1 st-2 bits of the 2-bit code, i.e. 8-bit code, for representing the major coding feature refrigerator 01 of the type of the device, the second coding region contains the 3 th-5 bits of the 3-8-bit code, i.e. 3-5-bit code, for representing the major coding feature double-door 001, the second coding region contains the 6-8-bit code, for representing the minor coding feature energy-saving and the double-door G2C, and then obtaining the coding 01001G2C of the energy-saving double-door refrigerator after determining the coding rule of the coding region.
In an exemplary embodiment, the encoding processor determines a device encoding of the target device from the encoding information, including: acquiring target coding regions in N coding regions of a plurality of equipment codes, wherein the plurality of equipment codes are stored in a database; determining whether the target coding region has reached a maximum coding; if yes, carrying out equipment coding again for the target equipment; and if not, sequentially determining the device codes of the target device according to the coding information and the device codes.
That is, in order to avoid repetition coding of the target device, it is ensured that the target device can perform normal coding when performing coding, when the coding processor determines the device coding of the target device according to the coding information, it may also determine whether the target coding region corresponding to the target device has reached the maximum coding through the generated multiple device codes stored in the database, where in order to improve coding efficiency, the target coding region is generally an nth coding region, when the nth coding region of the device coding has not reached the maximum coding, the coding processor may sequentially determine the device coding of the target device according to the coding information and the multiple device codes until the nth coding region reaches the maximum coding, and when the nth coding region of the device coding reaches the maximum coding, the coding processor needs to perform device coding again for the target device.
In an exemplary embodiment, the encoding processor determines a device encoding of the target device from the encoding information, including: initializing the encoding processor and loading the obtained encoding information of the target device; the encoding processor determines a device encoding of the target device based on the encoding information of the target device.
Because the target equipment has a plurality of types, when the coding processor codes the new target equipment, the initialization is needed, the acquired coding information of the target equipment is loaded, and then the equipment coding of the target equipment is determined according to the coding information of the target equipment, so that the interference of the previous coding on the new target equipment coding is avoided, and the coding error rate is reduced.
In order to better understand the process of the method for determining the device code, the following describes the flow of the method for determining the device code in conjunction with an alternative embodiment.
In an alternative embodiment of the present application, a method for determining a device code is mainly provided, where a device type code is stored in an ordered Tree Set system according to a desired coding sequence, and a single result is output to a device type code processor through an ordered Tree Set processor, and a required device code type is obtained through calculation.
It should be noted that the ordered Tree Set is an ordered Set, and its function is to provide an ordered Set of sets. The method is inherited in Abstract class of Abstract Set, realizes Navigable Set < E >, cloneable, java. Io.Serializable interface, and the ordered Tree Set has java. Io.Serializable interface, supports serialization, and is realized based on Tree Map. The elements in the Tree Set support 2 ordering modes: natural ordering or ordering according to the compilers provided when creating Tree Set.
Optionally, the Tree Set system includes a device type operation and maintenance platform 30, a device type encoding processor 32, and a Tree Set processor 34, where the device type operation and maintenance platform 30 is configured to transmit a user's creation request (corresponding to an encoding request in the embodiment of the present application) to an encoding processor application through a page, and carry information such as a device type name, a device description, etc. in the request information, so as to ensure accuracy of generating the encoding. A device type code processor 32 for creating a corresponding device type code according to a user's creation request. The Tree Set processor 34 may initialize the Tree Set content, load the corresponding character strings into the Tree Set system according to the user's (corresponding to the target object in the embodiment of the present application), for example, the character strings of 0-9, a-Z, etc., if the service needs, it may also implement the compatible interface through the storage object, rewrite the computer method according to the user's requirement, obtain the new computer ordering rule (corresponding to the coding information in the embodiment of the present application), and implement the flexible change of the coding sequence.
FIG. 3 is a call timing diagram of an ordered Tree Set system according to an alternative embodiment of the present application, including the following steps:
step one: the device type operation and maintenance platform sends a device class code creation request to the device type code processor.
Step two: the device type code processor forwards the device subclass code creation request to the Tree Set processor.
Step three: and the Tree Set processor is initialized.
Step four: and the Tree Set processor generates a single instance result of the equipment subclass code according to the loaded character string and the sequencing rule, and sends the single instance result to the equipment type code processor.
Step five: the device type encoding processor calculates a device type subclass encoding based on the singleton result.
Step six: the device type encoding processor transmits result data containing device type subclass codes to the device type operation and maintenance platform.
It should be noted that, the Tree Set processor 34 and the device type encoding processor 32 exist separately, or may be combined into one encoding processor according to needs, and in order to improve the efficiency of the method, the Tree Set processor adopts a single-case mode to initialize the Tree Set encoding data only once; so that the subsequent coding rule can be conveniently expanded in the Tree Set processor if the coding rule is changed or the coding sequence is changed, the alternative embodiment of the application is not excessively limited.
Alternatively, rules are now planned that represent device classification with eight-bit codes. Where each bit may be a number as well as a case letter. The major class of the device is represented by the first two bits, the middle class (carrying the major class information) is represented by the middle three bits of the eight bit code, and the minor class of the device is represented by the last three bits. Specific examples can be found in table 1 below:
TABLE 1
Encoding Coding type Description of the application
01 General coding Refrigerator with a refrigerator body
01001 Middle class coding Double door refrigerator
01001001 Subclass coding Double-door XX type refrigerator
02 General coding Air conditioner
0200a Middle class coding Cabinet air conditioner
0200a001 Subclass coding Cabinet YY type air conditioner
Optionally, fig. 4 is a schematic flow chart of applying device type coding according to an alternative embodiment of the present application; comprises the following steps:
step S402, applying for equipment type codes, initializing Tree Set content, and inquiring the maximum and minimum class codes of the current equipment type codes in a database;
in step S404, if the class in the current device type already exists in the database, the initial minimum class code is returned, as in the three-bit class code 001 of the refrigerator in table 1 above, when not.
Step S406, the class in the current equipment type has a subclass code in the database, and the high, middle and low three bits of the maximum class code under the class in the database are taken out.
Step S408, judging whether the low-order code is the maximum code, when the low-order code is not the maximum code, taking out the minimum value which is larger than the current low-order code in the Tree Set as the new low-order code, and returning to the step S408: high bit encoding + medium bit encoding + new low bit encoding, i.e. low bit plus 1.
Step S410, when determining that the low bit code is the maximum code, further judging whether the median code is the maximum code, when the median code is not the maximum code, taking out the minimum value larger than the current median code in the Tree Set as the new median code, and returning to: high bit encoding + median encoding + new low bit encoding, i.e. median 1.
Step S412, when the median code is determined to be the maximum code, the minimum value larger than the current high-order code in the Tree Set is taken out as the new high-order code, and the method returns: high bit encoding + medium bit encoding + new low bit encoding, i.e. high bit in 1.
In summary, through the alternative embodiment of the application, the Tree Set algorithm can be matched with a corresponding management page, the device type coding is maintained friendly and accurate, the flexible expansion of the device coding rule is supported, the performance of the coding processor is high, and the coding is accurate. Furthermore, the device type can be rapidly and accurately encoded according to the encoding sequence designated by the user and the encoding rule, so that different services can be conveniently developed based on different device types in the later period: such as subscribing to the service message of the device type accurately, pulling the function menu of the device type at the APP end, etc.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiment also provides a device code determining apparatus, which is used to implement the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 5 is a block diagram of a device code determining apparatus according to an embodiment of the present application, as shown in fig. 5, including:
(1) A receiving module 52, configured to receive an encoding request sent by a target object, where the encoding request is used to obtain a device encoding of a target device;
(2) An obtaining module 54, configured to respond to the encoding request and obtain encoding information preset by the target object for the target device;
(3) A determining module 56 is configured to determine a device code of the target device according to the code information.
Through the device, the encoding processor receives an encoding request sent by the target object, wherein the encoding request is used for acquiring the equipment code of the target equipment; the coding processor responds to the coding request and acquires coding information preset by the target object for the target device; the encoding processor determines the equipment encoding of the target equipment according to the encoding information, that is, the encoding processor realizes the conversion flow of the rapid encoding after the target object sends the encoding request, so that the problems of low encoding efficiency, high maintenance cost and the like of the target equipment in the prior art can be solved, the high efficiency of the encoding of the target equipment is ensured, and the maintenance cost of the encoding of the equipment is reduced.
In an exemplary embodiment, the receiving module is further configured to receive an encoding request created by the target object in the target platform, where the encoding request includes at least one of: the device type of the target device, and the description information of the target device.
That is, when the target object creates the code request for generating the target device, the device type of the target device and the description information of the target device need to be determined, for example, the target object creates the code request for generating the refrigerator in the target platform, where the code request may include information indicating that the refrigerator is double-door, energy-saving, environment-adaptive, etc., for expressing the device type of the refrigerator, and may further include information such as 092 model, low power, etc., for more accurately expressing the description information of the target device, so that the generated device code may be more accurate.
In an exemplary embodiment, the obtaining module is further configured to obtain, when the encoding information includes an encoding sequence and an encoding rule, a plurality of encoding information preset by the target object for a plurality of devices, where the encoding sequence is used to indicate that the device encodes corresponding string content, and the encoding rule is used to indicate N encoding regions corresponding to the device encoding, and device types corresponding to the N encoding regions respectively; and acquiring the coding information of the target equipment from the plurality of coding information.
In short, in order to improve the coding efficiency, the determination of the coding is quickened by acquiring preset coding information, and the preset coding information further comprises a coding sequence for indicating the corresponding character string content of the equipment coding and coding rules for indicating a plurality of coding areas of the equipment type of the equipment; in order to enable the equipment codes to contain more information, the content of the character strings corresponding to the equipment codes is diversified, loading of target character strings can be carried out according to the needs, and the coding sequence is edited again according to words; furthermore, since the target device can have multiple device type features at the same time, the device type features can be divided into a large class of coding features, a medium class of coding features and a small class of coding features according to the applicable range of the device type features, and the coding features are correspondingly stored in the corresponding coding regions.
In an exemplary embodiment, the above apparatus further includes: the dividing module is used for acquiring the equipment codes with the target length and dividing the equipment codes with the target length into N coding regions, wherein N is a positive integer greater than 1; n device types corresponding to the N coding regions respectively are determined, wherein the N device types at least comprise one of the following: device class, device model; and determining the coding rule according to the determined N coding regions and N device types corresponding to the N coding regions.
For example, when the target device is an energy-saving double-door refrigerator, the first N characters of the coding sequence may be defined as letters, the last N characters may be numbers, and the numbers or the coding interval positions may be modified according to coding information preset by the target object, so as to obtain a letter G representing the model of the energy-saving device, 2C representing the model of the double-door refrigerator, 02 representing the model of the double-door refrigerator, 1 representing the type of the device, assuming that the target length of the device code at this time is 8 bits, 3 coding regions exist, the first coding region contains the 1 st-2 bits of the 2-bit code, i.e. 8-bit code, for representing the major coding feature refrigerator 01 of the type of the device, the second coding region contains the 3 th-5 bits of the 3-8-bit code, i.e. 3-5-bit code, for representing the major coding feature double-door 001, the second coding region contains the 6-8-bit code, for representing the minor coding feature energy-saving and the double-door G2C, and then obtaining the coding 01001G2C of the energy-saving double-door refrigerator after determining the coding rule of the coding region.
In an exemplary embodiment, the obtaining module is further configured to obtain a target coding region from N coding regions of a plurality of device codes, where the plurality of device codes are stored in a database; determining whether the target coding region has reached a maximum coding; if yes, carrying out equipment coding again for the target equipment; and if not, sequentially determining the device codes of the target device according to the coding information and the device codes.
That is, in order to avoid repetition coding of the target device, it is ensured that the target device can perform normal coding when performing coding, when the coding processor determines the device coding of the target device according to the coding information, it may also determine whether the target coding region corresponding to the target device has reached the maximum coding through the generated multiple device codes stored in the database, where in order to improve coding efficiency, the target coding region is generally an nth coding region, when the nth coding region of the device coding has not reached the maximum coding, the coding processor may sequentially determine the device coding of the target device according to the coding information and the multiple device codes until the nth coding region reaches the maximum coding, and when the nth coding region of the device coding reaches the maximum coding, the coding processor needs to perform device coding again for the target device.
In an exemplary embodiment, the determining module is further configured to initialize the encoding processor, and load the obtained encoding information of the target device; the encoding processor determines a device encoding of the target device based on the encoding information of the target device.
Because the target equipment has a plurality of types, when the coding processor codes the new target equipment, the initialization is needed, the acquired coding information of the target equipment is loaded, and then the equipment coding of the target equipment is determined according to the coding information of the target equipment, so that the interference of the previous coding on the new target equipment coding is avoided, and the coding error rate is reduced.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
An embodiment of the application also provides a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In an exemplary embodiment, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, an encoding processor receives an encoding request sent by a target object, wherein the encoding request is used for acquiring equipment codes of target equipment;
s2, the coding processor responds to the coding request and acquires coding information preset by the target object on the target equipment;
and S3, the encoding processor determines the device encoding of the target device according to the encoding information. In an exemplary embodiment, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic apparatus may further include a transmission device connected to the processor, and an input/output device connected to the processor.
In an exemplary embodiment, in this embodiment, the above-mentioned processor may be configured to execute the following steps by a computer program:
s1, an encoding processor receives an encoding request sent by a target object, wherein the encoding request is used for acquiring equipment codes of target equipment;
s2, the coding processor responds to the coding request and acquires coding information preset by the target object on the target equipment;
and S3, the encoding processor determines the device encoding of the target device according to the encoding information. In an exemplary embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementations, and this embodiment is not repeated herein.
It will be apparent to those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, and in one exemplary embodiment they may be implemented in program code executable by a computing device, so that they may be stored in a memory device for execution by a computing device, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or a plurality of modules or steps in them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.

Claims (7)

1. A method for determining a device code, comprising:
the encoding processor receives an encoding request sent by a target object, wherein the encoding request is used for acquiring an equipment code of target equipment;
the coding processor responds to the coding request and acquires coding information preset by the target object for the target device;
the encoding processor determines the device encoding of the target device according to the encoding information, wherein obtaining the encoding information preset by the target object for the target device includes:
acquiring a plurality of pieces of coding information preset by the target object for a plurality of pieces of equipment under the condition that the coding information comprises a coding sequence and a coding rule, wherein the coding sequence is used for indicating the corresponding character string content coded by the equipment, and the coding rule is used for indicating N coding areas corresponding to the equipment coding and equipment types corresponding to the N coding areas respectively;
acquiring the coding information of the target device from the plurality of coding information, wherein the coding processor determines the device coding of the target device according to the coding information, and the method comprises the following steps:
acquiring target coding regions in N coding regions of a plurality of equipment codes, wherein the plurality of equipment codes are stored in a database;
determining whether the target coding region has reached a maximum coding;
if yes, carrying out equipment coding again for the target equipment;
if not, the device codes of the target device are sequentially determined according to the coding information and the device codes, wherein before the coding processor determines the device codes of the target device according to the coding information, the method further comprises:
acquiring the equipment code with the target length, and dividing the equipment code with the target length into N coding regions, wherein N is a positive integer greater than 1;
n device types corresponding to the N coding regions respectively are determined, wherein the N device types at least comprise one of the following: device class, device model;
and determining the coding rule according to the determined N coding regions and N device types corresponding to the N coding regions.
2. The method of claim 1, wherein the encoding processor receiving the encoding request sent by the target object comprises:
receiving an encoding request created in a target platform by a target object, wherein the encoding request comprises at least one of the following: the device type of the target device, and the description information of the target device.
3. The method of claim 1, wherein the encoding processor determining the device code of the target device based on the encoding information comprises:
initializing the encoding processor and loading the obtained encoding information of the target device;
the encoding processor determines a device encoding of the target device based on the encoding information of the target device.
4. A device code determining apparatus, comprising:
the receiving module is used for receiving an encoding request sent by a target object, wherein the encoding request is used for acquiring equipment encoding of target equipment;
the acquisition module is used for responding to the coding request and acquiring coding information preset by the target object on the target equipment;
the device code determining module is used for determining device codes of the target device according to the code information, wherein the acquiring module is also used for acquiring a plurality of pieces of code information preset by the target object for a plurality of devices under the condition that the code information comprises a code sequence and a code rule, wherein the code sequence is used for indicating the corresponding character string content of the device codes, the code rule is used for indicating N code areas corresponding to the device codes, and the N code areas respectively correspond to the device types; the method comprises the steps of obtaining coding information of target equipment from the plurality of coding information, wherein the obtaining module is further used for obtaining target coding areas in N coding areas of a plurality of equipment codes, and the plurality of equipment codes are stored in a database; determining whether the target coding region has reached a maximum coding; if yes, carrying out equipment coding again for the target equipment; if not, determining the device codes of the target device in turn according to the coding information and the plurality of device codes, wherein,
the apparatus further comprises: the dividing module is used for acquiring the equipment codes with the target length and dividing the equipment codes with the target length into N coding regions, wherein N is a positive integer greater than 1; n device types corresponding to the N coding regions respectively are determined, wherein the N device types at least comprise one of the following: device class, device model; and determining the coding rule according to the determined N coding regions and N device types corresponding to the N coding regions.
5. The apparatus of claim 4, wherein the receiving module is further configured to receive an encoding request created in the target platform by the target object comprising at least one of: the device type of the target device, and the description information of the target device.
6. A computer-readable storage medium, characterized in that the storage medium has stored therein a computer program, wherein the computer program is arranged to perform the method of any of claims 1 to 3 when run.
7. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 3.
CN202011380164.3A 2020-11-30 2020-11-30 Method and device for determining equipment codes, storage medium and electronic device Active CN112600946B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011380164.3A CN112600946B (en) 2020-11-30 2020-11-30 Method and device for determining equipment codes, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011380164.3A CN112600946B (en) 2020-11-30 2020-11-30 Method and device for determining equipment codes, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112600946A CN112600946A (en) 2021-04-02
CN112600946B true CN112600946B (en) 2023-08-22

Family

ID=75187440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011380164.3A Active CN112600946B (en) 2020-11-30 2020-11-30 Method and device for determining equipment codes, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112600946B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019019535A1 (en) * 2017-07-27 2019-01-31 广州视源电子科技股份有限公司 Method for sending, forwarding and transmitting data, and apparatus for sending, forwarding and transmitting data
CN109542965A (en) * 2018-11-07 2019-03-29 平安医疗健康管理股份有限公司 A kind of data processing method, electronic equipment and storage medium
CN110309374A (en) * 2019-05-22 2019-10-08 深圳市金泰克半导体有限公司 A kind of analytic method, system, terminal device and computer readable storage medium
CN110362542A (en) * 2019-07-15 2019-10-22 岭澳核电有限公司 Nuclear power station document No. method, apparatus, computer equipment and storage medium
CN110750724A (en) * 2019-10-24 2020-02-04 北京思维造物信息科技股份有限公司 Data processing method, device, equipment and storage medium
CN111611449A (en) * 2020-05-08 2020-09-01 百度在线网络技术(北京)有限公司 Information encoding method and device, electronic equipment and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10395231B2 (en) * 2016-06-27 2019-08-27 Altria Client Services Llc Methods, systems, apparatuses, and non-transitory computer readable media for validating encoded information
CN110457025B (en) * 2018-05-07 2022-04-12 腾讯科技(深圳)有限公司 Bar code display method and device, storage medium and electronic device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019019535A1 (en) * 2017-07-27 2019-01-31 广州视源电子科技股份有限公司 Method for sending, forwarding and transmitting data, and apparatus for sending, forwarding and transmitting data
CN109542965A (en) * 2018-11-07 2019-03-29 平安医疗健康管理股份有限公司 A kind of data processing method, electronic equipment and storage medium
CN110309374A (en) * 2019-05-22 2019-10-08 深圳市金泰克半导体有限公司 A kind of analytic method, system, terminal device and computer readable storage medium
CN110362542A (en) * 2019-07-15 2019-10-22 岭澳核电有限公司 Nuclear power station document No. method, apparatus, computer equipment and storage medium
CN110750724A (en) * 2019-10-24 2020-02-04 北京思维造物信息科技股份有限公司 Data processing method, device, equipment and storage medium
CN111611449A (en) * 2020-05-08 2020-09-01 百度在线网络技术(北京)有限公司 Information encoding method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN112600946A (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN108736899B (en) A kind of polarization code coding/decoding method and device
CN108108436B (en) Data storage method and device, storage medium and electronic equipment
CN107562743A (en) Date storage method and device, the treating method and apparatus of data search request
CN108875035B (en) Data storage method of distributed file system and related equipment
CN111274249A (en) User image data storage optimization method, device and readable storage medium
CN104331330A (en) Resource pool generation method and device
CN112600946B (en) Method and device for determining equipment codes, storage medium and electronic device
CN110266834B (en) Area searching method and device based on internet protocol address
CN114492849B (en) Model updating method and device based on federal learning
WO2022267714A1 (en) Inverse reinforcement learning processing method and apparatus, storage medium, and electronic apparatus
CN114466387B (en) Updating method and device of configuration file of base station, storage medium and electronic device
CN110166318A (en) A kind of data statistical approach and device
CN105634999A (en) Aging method and device for medium access control address
CN103810157A (en) Method and device for achieving input method
CN114201499B (en) Data uploading method and device and computer equipment
CN113760809B (en) Configuration method, system and device of GPIO interface and readable storage medium
CN110727442B (en) Data storage optimization method and system for embedded platform
CN116860464B (en) Load resource allocation method and device, storage medium and electronic device
CN115032901B (en) Equipment control method and electronic equipment
CN116339703B (en) Bus interface code generation method and device, electronic equipment and medium
CN116306884B (en) Pruning method and device for federal learning model and nonvolatile storage medium
CN114328314A (en) Address automatic acquisition method, device, terminal equipment and storage medium
CN109740806A (en) The management method and device of node link, storage medium, electronic device
CN113946394A (en) Method and device for displaying task flow running result in real time and electronic equipment
CN117251967A (en) Topology data acquisition method, device, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant