Control method and apparatus for device, storage medium, and electronic device
Patent Information
- Application Number
- CN202310087030.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-31
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2043-01-31
AI Technical Summary
[0005]本申请实施例提供了一种设备的控制方法和装置、存储介质及电子装置,以至少解决相关技术中,需要针对每个历史版本的标准设备分别创建对应的映射文件,进而导致效率较低等问题
[0016] In this embodiment, the differences between the first functional model data of a first standard device in multiple historical versions and the second functional model data of a second standard device in the current version are determined, wherein the first standard device and the second standard device belong to the same device category; the first functional model data corresponding to the same difference data are divided into the same group to obtain multiple groups; a mapping file for each group is established according to the difference data corresponding to each group, and the first standard device is controlled through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data; by adopting the above technical solution, the problem of low efficiency caused by creating corresponding mapping files for each historical version of the standard device is solved, thereby avoiding the need to create corresponding mapping files for historical versions of the standard device and simplifying the processing of historical standard device data.
Smart Images

Figure CN116107975B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home technology, and more specifically, to a control method and apparatus for a device, a storage medium, and an electronic device. Background Technology
[0002] With the rapid development of the Internet of Things, home appliances are becoming increasingly intelligent, and the updates and iterations of home appliance versions are becoming more and more frequent. When defining the corresponding functional attributes of standard devices in the early stages of the past, the functional definition rules differed from the current rules. For example, there may be functions with different names but expressing the same meaning, or the identification names may not conform to the current rules. As a result, some functions of the standard devices in the past version of the current product category differ from some functions of the standard devices in the current version. When using the existing model library to distribute attributes, it is impossible to control some functions of the standard devices in the past version through the standard model library of the current product category.
[0003] In related technologies, a corresponding mapping file is created for each historical version of the standard device, so as to perform mapping conversion with the current version of the standard model library. However, there are many historical versions of the standard device, and multiple tedious mapping files need to be created manually.
[0004] There is no effective solution yet to address the issues in related technologies, such as the need to create corresponding mapping files for each historical version of standard devices, which leads to low efficiency. Summary of the Invention
[0005] This application provides a device control method and apparatus, storage medium and electronic device to at least solve the problems in the related art, such as the need to create corresponding mapping files for each historical version of standard device, which leads to low efficiency.
[0006] According to one embodiment of this application, a device control method is provided, comprising: determining difference data between first functional model data of a first standard device of a plurality of historical versions and second functional model data of a second standard device of a current version, wherein the first standard device and the second standard device belong to the same device category; dividing the first functional model data corresponding to the same difference data into the same group to obtain multiple groups; establishing a mapping file for each group according to the difference data corresponding to each group, and controlling the first standard device through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data.
[0007] In an exemplary embodiment, determining the difference data between the first functional model data of a first standard device in multiple historical versions and the second functional model data of a second standard device in the current version includes: determining the first functional attribute information of the first standard device in any historical version in the first functional model data corresponding to any historical version, and determining the second functional attribute information of the second standard device in the second functional model data; determining the difference data between the first functional attribute information and the second functional attribute information, wherein the difference data indicates at least one of the following: difference in the name of the same functional attribute, difference in the value range of the same functional attribute, and difference in the data type of the same functional attribute.
[0008] In one exemplary embodiment, establishing a mapping file for each group based on the difference data corresponding to each group includes: establishing a first mapping relationship between multiple first functional attribute information and second functional attribute information based on the difference data corresponding to each group; and establishing a mapping file for each group based on the multiple first mapping relationships.
[0009] In one exemplary embodiment, establishing a mapping file for each group based on a plurality of the first mapping relationships includes at least one of the following: when the difference data indicates a name difference of the same functional attribute, determining a second mapping relationship between a first name and a second name of the same functional attribute, and establishing a mapping file for each group based on the second mapping relationship, wherein the first functional attribute information includes: the first name, and the second functional attribute information includes: the second name; when the difference data indicates a value range of the same functional attribute, determining a third mapping relationship between a first value range and a second value range of the same functional attribute, and establishing a mapping file for each group based on the third mapping relationship, wherein the first functional attribute information includes: the first value range, and the second functional attribute information includes: the second value range; when the difference data indicates a data type difference of the same functional attribute, determining a fourth mapping relationship between a first data type and a second data type of the same functional attribute, and establishing a mapping file for each group based on the fourth mapping relationship, wherein the first functional attribute information includes: the first data type, and the second functional attribute information includes: the second data type.
[0010] In one exemplary embodiment, controlling the first standard device through a plurality of mapping files includes: upon receiving a first control instruction for controlling a target historical version of the first standard device, determining third functional model data of the target historical version of the first standard device and a first group corresponding to the third functional model data; determining a first mapping file corresponding to the first group, wherein the plurality of mapping files includes at least the first mapping file; and controlling the target historical version of the first standard device according to the first mapping file.
[0011] In an exemplary embodiment, controlling the first standard device of the target historical version according to the first mapping file includes: determining whether a fifth mapping relationship corresponding to a first attribute exists in the first mapping file, wherein the control instruction is used to control the first attribute of the first standard device of the target historical version; if the fifth mapping relationship does not exist in the first mapping file, directly sending the first control instruction to the first standard device of the target historical version; if the fifth mapping relationship exists in the first mapping file, converting the first control instruction into a second control instruction according to the fifth mapping relationship, and sending the second control instruction to the first standard device of the target historical version.
[0012] In an exemplary embodiment, converting the first control instruction into a second control instruction according to the fifth mapping relationship includes at least one of the following: when the fifth mapping relationship indicates a mapping relationship for the name of the first attribute, adjusting the name of the first attribute in the first control instruction according to the fifth mapping relationship to obtain the second control instruction; when the fifth mapping relationship indicates a range of attribute values for the first attribute, adjusting the range of attribute values for the first attribute in the first control instruction according to the fifth mapping relationship to obtain the second control instruction; when the fifth mapping relationship indicates a difference in the data type of the first attribute, adjusting the difference in the data type of the first attribute in the first control instruction according to the fifth mapping relationship to obtain the second control instruction.
[0013] According to another embodiment of the present application, a device control apparatus is also provided, comprising: a determining module, configured to determine difference data between first functional model data of a first standard device of a plurality of historical versions and second functional model data of a second standard device of the current version, wherein the first standard device and the second standard device belong to the same device category; a dividing module, configured to divide the first functional model data corresponding to the same difference data into the same group to obtain multiple groups; and a controlling module, configured to establish a mapping file for each group according to the difference data corresponding to each group, and control the first standard device through the multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the control method of the above-described device when it is run.
[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the control method of the device through the computer program.
[0016] In this embodiment, the differences between the first functional model data of a first standard device in multiple historical versions and the second functional model data of a second standard device in the current version are determined, wherein the first standard device and the second standard device belong to the same device category; the first functional model data corresponding to the same difference data are divided into the same group to obtain multiple groups; a mapping file for each group is established according to the difference data corresponding to each group, and the first standard device is controlled through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data; by adopting the above technical solution, the problem of low efficiency caused by creating corresponding mapping files for each historical version of the standard device is solved, thereby avoiding the need to create corresponding mapping files for historical versions of the standard device and simplifying the processing of historical standard device data. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the hardware environment of a device control method according to an embodiment of this application;
[0020] Figure 2 This is a flowchart of a device control method according to an embodiment of this application;
[0021] Figure 3 This is a flowchart of a device control method according to an embodiment of this application;
[0022] Figure 4 This is a schematic diagram (a) of a device control method according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram (II) of a device control method according to an embodiment of this application;
[0024] Figure 6 This is a structural block diagram of a control device for an apparatus according to an embodiment of this application. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] According to one aspect of the embodiments of this application, a device control method is provided. This device control method is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned device control method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0028] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0029] This embodiment provides a device control method applied to a computer terminal. Figure 2 This is a flowchart of a device control method according to an embodiment of this application, the process including the following steps:
[0030] Step S202: Determine the difference data between the first functional model data of the first standard device in multiple historical versions and the second functional model data of the second standard device in the current version, wherein the first standard device and the second standard device belong to the same equipment category;
[0031] Step S204: Divide the first functional model data corresponding to the same difference data into the same group to obtain multiple groups;
[0032] Specifically, multiple sets of differential data are identified from multiple differential data sets, wherein the differential data in each set of differential data sets are identical; the first functional model data corresponding to each set of differential data sets are divided into the same group to obtain multiple groups.
[0033] Step S206: Establish a mapping file for each group based on the difference data corresponding to each group, and control the first standard device through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data.
[0034] Through the above steps, the differences between the first functional model data of multiple historical versions of the first standard device and the second functional model data of the current version of the second standard device are determined, wherein the first standard device and the second standard device belong to the same device category; the first functional model data corresponding to the same difference data are divided into the same group to obtain multiple groups; a mapping file is established for each group according to the difference data corresponding to each group, and the first standard device is controlled through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data. This solves the problem in related technologies that it is necessary to create corresponding mapping files for each historical version of the standard device, which leads to low efficiency. This avoids the need to create corresponding mapping files for historical versions of the standard device and simplifies the processing of historical standard device data.
[0035] In an exemplary embodiment, determining the difference data between the first functional model data of a first standard device in multiple historical versions and the second functional model data of a second standard device in the current version includes: determining the first functional attribute information of the first standard device in any historical version in the first functional model data corresponding to any historical version, and determining the second functional attribute information of the second standard device in the second functional model data; determining the difference data between the first functional attribute information and the second functional attribute information, wherein the difference data indicates at least one of the following: difference in the name of the same functional attribute, difference in the value range of the same functional attribute, and difference in the data type of the same functional attribute.
[0036] Understandably, historical versions include: v1, v2...vn. The first functional attribute information of the device in version v1 is determined from the first functional model data, and the second functional attribute information of the device in the current version is determined from the second functional model data. Based on the first functional attribute information of the device in version v1 and the second functional attribute information of the device in the current version, the name differences and / or value ranges and / or data type differences of the same functional attribute corresponding to the device in version v1 and the device in the current version are determined. This process is repeated until the name differences and / or value ranges and / or data type differences of the same functional attribute corresponding to the device in version vn and the device in the current version are determined.
[0037] For example, the lighting function of the current version of the electric steam oven is named "lightingstatus," while the lighting function of the v1 version is named "lightstatus," meaning that the same functional attribute has a different name across different versions of the electric steam oven; the heating function of the current version of the electric steam oven uses an enumeration data type, while the heating function of the v1 version uses an integer data type, meaning that the same functional attribute has a different data type across different versions of the electric steam oven; the data value range for the heating function of the current version of the electric steam oven is [0, 300], while the data value range for the heating function of the v1 version is [0, 320], meaning that the value range for the same functional attribute differs across different versions of the electric steam oven.
[0038] Furthermore, given that the second functional attribute information of the current version of the device includes: attribute information of function 1, attribute information of function 2, attribute information of function 3, and attribute information of function 4, while the second functional attribute information of the v1 version device includes: attribute information of function 1, attribute information of function 2, and attribute information of function 3, it is only necessary to compare the difference data corresponding to the attribute information of function 1, attribute information of function 2, and attribute information of function 3 in the two versions.
[0039] In one exemplary embodiment, establishing a mapping file for each group based on the difference data corresponding to each group includes: establishing a first mapping relationship between multiple first functional attribute information and second functional attribute information based on the difference data corresponding to each group; and establishing a mapping file for each group based on the multiple first mapping relationships.
[0040] Specifically, the above-mentioned establishment of mapping files for each group based on multiple first mapping relationships is achieved through at least one of the following methods: When the difference data indicates a name difference for the same functional attribute, a second mapping relationship between the first name and the second name of the same functional attribute is determined, and a mapping file for each group is established based on the second mapping relationship, wherein the first functional attribute information includes: the first name, and the second functional attribute information includes: the second name; When the difference data indicates a value range for the same functional attribute, a third mapping relationship between the first value range and the second value range of the same functional attribute is determined, and a mapping file for each group is established based on the third mapping relationship, wherein the first functional attribute information includes: the first value range, and the second functional attribute information includes: the second value range; When the difference data indicates a data type difference for the same functional attribute, a fourth mapping relationship between the first data type and the second data type of the same functional attribute is determined, and a mapping file for each group is established based on the fourth mapping relationship, wherein the first functional attribute information includes: the first data type, and the second functional attribute information includes: the second data type.
[0041] For example, the lighting function of the current version of the electric steam oven is named "lightingstatus," while the lighting function of the v1 version is named "lightstatus." This means that the same functional attribute has different names across different versions of the steam oven, thus establishing a mapping relationship between "lightingstatus" and "lightstatus." Similarly, the heating function of the current version of the electric steam oven uses an enumeration data type, while the heating function of the v1 version uses an integer data type. This also means that the same functional attribute has different data types across different versions of the steam oven, thus establishing an enumeration and integer data type mapping relationship for the heating function. Furthermore, the heating function of the current version of the electric steam oven has a data value range of [0, 300], while the heating function of the v1 version has a data value range of [0, 320]. This means that the same functional attribute has different value ranges across different versions of the steam oven, thus establishing a mapping relationship between [0, 300] and [0, 320] for the heating function.
[0042] In one exemplary embodiment, controlling the first standard device through a plurality of mapping files includes: upon receiving a first control instruction for controlling a target historical version of the first standard device, determining third functional model data of the target historical version of the first standard device and a first group corresponding to the third functional model data; determining a first mapping file corresponding to the first group, wherein the plurality of mapping files includes at least the first mapping file; and controlling the target historical version of the first standard device according to the first mapping file.
[0043] In other words, upon receiving a control command to control a device of a historical version, the group corresponding to the historical version of the device is determined, and the first mapping file corresponding to the group is determined. Then, the first control command is adjusted according to the mapping file, and the first standard device is controlled through the adjusted first control command. This enables the control of the historical version of the device to be completed using the current standard model library, and the current standard model library is uniformly opened to the outside world.
[0044] In an exemplary embodiment, controlling the first standard device of the target historical version according to the first mapping file includes: determining whether a fifth mapping relationship corresponding to a first attribute exists in the first mapping file, wherein the control instruction is used to control the first attribute of the first standard device of the target historical version; if the fifth mapping relationship does not exist in the first mapping file, directly sending the first control instruction to the first standard device of the target historical version; if the fifth mapping relationship exists in the first mapping file, converting the first control instruction into a second control instruction according to the fifth mapping relationship, and sending the second control instruction to the first standard device of the target historical version.
[0045] It should be noted that, upon receiving a first control instruction, the system determines the first attribute of the historical version of the device to be controlled based on the first control instruction; it then determines whether a mapping relationship for the first attribute exists in the first mapping file; if a mapping relationship for the first attribute exists in the first mapping file, it indicates that the first attribute of the historical version of the device differs from the first attribute of the current version of the device, and the first control instruction is adjusted to obtain a second control instruction, which then controls the historical version of the device; if a mapping relationship for the first attribute does not exist in the first mapping file, it indicates that the first attribute of the historical version of the device differs from the first attribute of the current version of the device, and therefore, no adjustment to the first control instruction is required, and the historical version of the device is directly controlled by the second control instruction. This enables the control of historical version devices using the current standard model library, and the current standard model library is made publicly available.
[0046] In an exemplary embodiment, converting the first control instruction into a second control instruction according to the fifth mapping relationship includes at least one of the following: when the fifth mapping relationship indicates a mapping relationship for the name of the first attribute, adjusting the name of the first attribute in the first control instruction according to the fifth mapping relationship to obtain the second control instruction; when the fifth mapping relationship indicates a range of attribute values for the first attribute, adjusting the range of attribute values for the first attribute in the first control instruction according to the fifth mapping relationship to obtain the second control instruction; when the fifth mapping relationship indicates a difference in the data type of the first attribute, adjusting the difference in the data type of the first attribute in the first control instruction according to the fifth mapping relationship to obtain the second control instruction.
[0047] For example, if the mapping file includes a mapping relationship between lighting status and light status for lighting functions, upon receiving a first control command for controlling the lighting function of a historical version of the device, "lighting status" in the first control command is modified to "light status", thereby controlling the lighting function of the historical version of the device; if the mapping file includes a mapping relationship between enumeration type and integer type for heating functions, upon receiving a first control command for controlling the heating function of a historical version of the device, the integer type value in the first control command is modified to the corresponding enumeration type value.
[0048] In one exemplary embodiment, determining the difference data between first functional model data of a first standard device in multiple historical versions and second functional model data of a second standard device in the current version includes: automatically acquiring a script for comparing the first functional model data and the second functional model data through target software; automatically comparing the first functional model data and the second functional model data with the script through the target software, and obtaining the difference data.
[0049] In this embodiment of the invention, the comparison of differences between historical equipment functional model data and standard functional data in the model library, as well as the version classification, are handled by the target script, which simplifies the processing of historical standard equipment data.
[0050] To better understand the process of the control method of the above-mentioned device, the implementation flow of the control method of the above-mentioned device will be described below in conjunction with optional embodiments, but it is not intended to limit the technical solution of the embodiments of this application.
[0051] This embodiment provides a method for controlling a device. Figure 3This is a schematic diagram (a) of a device control method according to an embodiment of this application, as shown below. Figure 3 As shown, the specific steps are as follows:
[0052] Step S301: Determine the differences between the historical standard model library of historical standard equipment and the current standard model library of current standard equipment;
[0053] Step S302: Group the difference data to determine the grouping results, wherein the difference data corresponding to each group is the same;
[0054] like Figure 4 As shown, historical versions typeid1, typeid2, and typeid3 have identical differential data corresponding to the child lock status function. Therefore, the standard data models corresponding to typeid1, typeid2, and typeid3 are divided into group 4. Historical version typeid4 has differential data corresponding to the lighting function status, running status, and child lock status. Therefore, the standard data model corresponding to typeid4 is divided into group 3. Typeid5 has differential data corresponding to the lighting function status and child lock status. Therefore, the standard data model corresponding to typeid5 is divided into group 2. Historical versions typeid6, typeid7, typeid8, and typeid9 have identical differential data corresponding to the child lock status function and running status. Therefore, the standard data models corresponding to typeid6, typeid7, typeid8, and typeid9 are divided into group 1.
[0055] Step S303: Generate the corresponding number of historical versions based on the grouping results;
[0056] Step S304: Assign the version number of the current version to the historical devices corresponding to the version differences;
[0057] Step S305: As Figure 5 As shown, a corresponding mapping relationship is established based on the differences between each historical version and the standard model library.
[0058] This invention avoids the need for developers to create corresponding mapping conversion files for each historical device, simplifying the processing of historical standard device data; it delegates the comparison of differences between historical device functional model data and standard functional data in the model library, as well as version classification, to the program; it strictly defines the historical standard device processing procedure, improves process control, and avoids problems caused by manually creating mappings.
[0059] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0060] Figure 6 This is a structural block diagram of a control device for an apparatus according to an embodiment of this application; as shown below. Figure 6 As shown, it includes:
[0061] The determination module 62 is used to determine the difference data between the first functional model data of the first standard device in multiple historical versions and the second functional model data of the second standard device in the current version, wherein the first standard device and the second standard device belong to the same equipment category;
[0062] The partitioning module 64 is used to partition the first functional model data corresponding to the same difference data into the same group to obtain multiple groups;
[0063] The control module 66 is used to establish a mapping file for each group based on the difference data corresponding to each group, and to control the first standard device through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data.
[0064] Using the aforementioned apparatus, the differences between the first functional model data of a first standard device in multiple historical versions and the second functional model data of a second standard device in the current version are determined, wherein the first standard device and the second standard device belong to the same device category; the first functional model data corresponding to the same difference data are divided into the same group to obtain multiple groups; a mapping file is established for each group according to the difference data corresponding to each group, and the first standard device is controlled through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data. This solves the problem in related technologies that it is necessary to create corresponding mapping files for each historical version of the standard device, resulting in low efficiency, and thus avoids the need to create corresponding mapping files for historical versions of the standard device, simplifying the processing of historical standard device data.
[0065] In an exemplary embodiment, the determining module 62 is configured to determine, in the first functional model data corresponding to any historical version, the first functional attribute information of the first standard device of the first historical version, and in the second functional model data, the second functional attribute information of the second standard device; and to determine the difference data between the first functional attribute information and the second functional attribute information, wherein the difference data indicates at least one of the following: difference in the name of the same functional attribute, difference in the value range of the same functional attribute, and difference in the data type of the same functional attribute.
[0066] In an exemplary embodiment, the determining module 62 is configured to establish a first mapping relationship between a plurality of first functional attribute information and second functional attribute information based on the difference data corresponding to each group; and to establish a mapping file for each group based on the plurality of first mapping relationships.
[0067] In an exemplary embodiment, the determining module 62 is configured to: determine a second mapping relationship between a first name and a second name of the same functional attribute when the difference data indicates a name difference of the same functional attribute; establish a mapping file for each group based on the second mapping relationship, wherein the first functional attribute information includes: the first name, and the second functional attribute information includes: the second name; determine a third mapping relationship between a first value range and a second value range of the same functional attribute when the difference data indicates an attribute value range of the same functional attribute; establish a mapping file for each group based on the third mapping relationship, wherein the first functional attribute information includes: the first value range, and the second functional attribute information includes: the second value range; and determine a fourth mapping relationship between a first data type and a second data type of the same functional attribute when the difference data indicates a data type difference of the same functional attribute; establish a mapping file for each group based on the fourth mapping relationship, wherein the first functional attribute information includes: the first data type, and the second functional attribute information includes: the second data type.
[0068] In an exemplary embodiment, the control module 66 is configured to, upon receiving a first control instruction for controlling a first standard device of a target historical version, determine third functional model data of the first standard device of the target historical version and a first group corresponding to the third functional model data; determine a first mapping file corresponding to the first group, wherein the plurality of mapping files includes at least the first mapping file; and control the first standard device of the target historical version according to the first mapping file.
[0069] In an exemplary embodiment, the control module 66 is configured to determine whether a fifth mapping relationship corresponding to a first attribute exists in the first mapping file, wherein the control instruction is used to control the first attribute of the first standard device of the target historical version; if the fifth mapping relationship does not exist in the first mapping file, the first control instruction is directly sent to the first standard device of the target historical version; if the fifth mapping relationship exists in the first mapping file, the first control instruction is converted into a second control instruction according to the fifth mapping relationship, and the second control instruction is sent to the first standard device of the target historical version.
[0070] In one exemplary embodiment, the control module 66 is configured to: adjust the name of the first attribute in the first control instruction according to the fifth mapping relationship when the fifth mapping relationship indicates a mapping relationship for the name of the first attribute, to obtain the second control instruction; adjust the attribute value range of the first attribute in the first control instruction according to the fifth mapping relationship when the fifth mapping relationship indicates an attribute value range for the first attribute, to obtain the second control instruction; and adjust the data type difference of the first attribute in the first control instruction according to the fifth mapping relationship when the fifth mapping relationship indicates a data type difference for the first attribute, to obtain the second control instruction.
[0071] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0072] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0073] S1, determine the difference data between the first functional model data of the first standard equipment in multiple historical versions and the second functional model data of the second standard equipment in the current version, wherein the first standard equipment and the second standard equipment belong to the same equipment category;
[0074] S2, group the first functional model data corresponding to the same difference data into the same group to obtain multiple groups;
[0075] S3, establish a mapping file for each group based on the difference data corresponding to each group, and control the first standard device through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data.
[0076] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0077] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0078] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0079] S1, determine the difference data between the first functional model data of the first standard equipment in multiple historical versions and the second functional model data of the second standard equipment in the current version, wherein the first standard equipment and the second standard equipment belong to the same equipment category;
[0080] S2, group the first functional model data corresponding to the same difference data into the same group to obtain multiple groups;
[0081] S3, establish a mapping file for each group based on the difference data corresponding to each group, and control the first standard device through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data.
[0082] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0083] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0084] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0085] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for controlling a device, characterized in that, include: The differences between the first functional model data of the first standard equipment in multiple historical versions and the second functional model data of the second standard equipment in the current version are determined, wherein the first standard equipment and the second standard equipment belong to the same equipment category; The first functional model data corresponding to the same difference data are divided into the same group to obtain multiple groups; A mapping file is established for each group based on the difference data corresponding to each group, and the first standard device is controlled through multiple mapping files. The mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data. The control of the first standard device through multiple mapping files includes: Upon receiving a first control command for controlling a first standard device of a target historical version, the third functional model data of the first standard device of the target historical version and the first grouping corresponding to the third functional model data are determined. Determine the first mapping file corresponding to the first group, wherein the plurality of mapping files includes at least the first mapping file; Control the first standard device of the target historical version according to the first mapping file; Among them, the differences between the first functional model data of the first standard device in multiple historical versions and the second functional model data of the second standard device in the current version are identified, including: In the first functional model data corresponding to any historical version, determine the first functional attribute information of the first standard device of the any historical version, and determine the second functional attribute information of the second standard device in the second functional model data; Determine the difference data between the first functional attribute information and the second functional attribute information, wherein the difference data indicates at least one of the following: difference in the name of the same functional attribute, difference in the value range of the same functional attribute, or difference in the data type of the same functional attribute.
2. The control method for the device according to claim 1, characterized in that, Based on the difference data corresponding to each group, a mapping file is created for each group, including: Based on the difference data corresponding to each group, establish a first mapping relationship between multiple first functional attribute information and second functional attribute information; A mapping file for each group is established based on the multiple first mapping relationships.
3. The control method for the device according to claim 2, characterized in that, A mapping file for each group is established based on multiple of the first mapping relationships, including at least one of the following: When the difference data indicates a name difference for the same functional attribute, a second mapping relationship between the first name and the second name of the same functional attribute is determined, and a mapping file for each group is established according to the second mapping relationship, wherein the first functional attribute information includes: the first name, and the second functional attribute information includes: the second name; When the difference data indicates the attribute value range of the same functional attribute, a third mapping relationship between the first value range and the second value range of the same functional attribute is determined, and a mapping file for each group is established according to the third mapping relationship, wherein the first functional attribute information includes: the first value range, and the second functional attribute information includes: the second value range; When the difference data indicates a difference in the data type of the same functional attribute, a fourth mapping relationship between the first data type and the second data type of the same functional attribute is determined, and a mapping file for each group is established according to the fourth mapping relationship, wherein the first functional attribute information includes the first data type, and the second functional attribute information includes the second data type.
4. The control method for the device according to claim 1, characterized in that, Controlling the first standard device of the target historical version according to the first mapping file includes: Determine whether a fifth mapping relationship corresponding to a first attribute exists in the first mapping file, wherein the control instruction is used to control the first attribute of the first standard device of the target historical version; If the fifth mapping relationship does not exist in the first mapping file, the first control command is sent directly to the first standard device of the target historical version. If the fifth mapping relationship exists in the first mapping file, the first control instruction is converted into a second control instruction according to the fifth mapping relationship, and the second control instruction is sent to the first standard device of the target historical version.
5. The control method for the device according to claim 4, characterized in that, The conversion of the first control instruction into a second control instruction based on the fifth mapping relationship includes at least one of the following: When the fifth mapping relationship indicates the mapping relationship of the name of the first attribute, the name of the first attribute in the first control instruction is adjusted according to the fifth mapping relationship to obtain the second control instruction; When the fifth mapping relationship indicates the attribute value range of the first attribute, the attribute value range of the first attribute in the first control instruction is adjusted according to the fifth mapping relationship to obtain the second control instruction; When the fifth mapping relationship indicates a difference in the data type of the first attribute, the data type difference of the first attribute in the first control instruction is adjusted according to the fifth mapping relationship to obtain the second control instruction.
6. A control device for an equipment, characterized in that, include: The determination module is used to determine the difference data between the first functional model data of the first standard device in multiple historical versions and the second functional model data of the second standard device in the current version, wherein the first standard device and the second standard device belong to the same device category; The partitioning module is used to partition the first functional model data corresponding to the same difference data into the same group to obtain multiple groups; The control module is used to establish a mapping file for each group based on the difference data corresponding to each group, and to control the first standard device through multiple mapping files, wherein the mapping file is used to indicate the mapping relationship between the first functional model data and the second functional model data; The control module is further configured to, upon receiving a first control command for controlling a first standard device of a target historical version, determine the third functional model data of the first standard device of the target historical version, and the first group corresponding to the third functional model data; determine the first mapping file corresponding to the first group, wherein the plurality of mapping files includes at least the first mapping file; and control the first standard device of the target historical version according to the first mapping file. The determining module is further configured to determine, in the first functional model data corresponding to any historical version, the first functional attribute information of the first standard device of any historical version, and the second functional attribute information of the second standard device in the second functional model data; and to determine the difference data between the first functional attribute information and the second functional attribute information, wherein the difference data indicates at least one of the following: difference in the name of the same functional attribute, difference in the value range of the same functional attribute, and difference in the data type of the same functional attribute.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 5.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 5 through the computer program.
Citation Information
Patent Citations
Relay protection device midpoint table conversion method
CN108897563A