External unit equipment and multi-type slave matching method and device and storage medium
By obtaining slave software codes and matching with the external device support list, filtering the target software codes and performing pattern conversion, the problem of insufficient flexibility and reliability of the traditional external device control system is solved, and the flexible adaptation of external devices and system stability is achieved between external devices and multiple slaves.
Patent Information
- Application Number
- CN202411987896.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-06-06
AI Technical Summary
Because the traditional external equipment control system relies on the control information provided by the internal fan disk, its function and mode adjustment are limited, which is difficult to meet the diverse market demands. The stability and reliability of the system depend highly on the normal operation and communication quality of the internal fan disk.
By obtaining the slave's software code and matching it with the preset support list of the external device, the target software code is filtered out, and the external device is converted based on the slave type corresponding to the software code to obtain the adapted device status.
It realizes flexible adaptation of external devices with multiple types of slaves, without relying on specific hardware interfaces or communication protocols, significantly improving the flexibility and reliability of the system, ensuring that the device can still operate normally in the face of slave type changes or failures.
Smart Images

Figure CN120104172A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of device communication, and in particular to a matching method, device and storage medium for an external device and multiple types of slave devices. Background Art
[0002] The traditional outdoor equipment control system relies on the control information provided by the indoor fan disk. In this way, the function and mode adjustment of the outdoor equipment are strictly limited to the control instructions and data that the indoor fan disk can provide. Since the design and function of the indoor fan disk are often targeted at specific application scenarios and user needs, this dependency greatly limits the application scenarios of the outdoor equipment, making it difficult to meet the increasingly diverse market needs. Furthermore, since the stability and reliability of the entire system are highly dependent on the normal operation and communication quality of the indoor fan disk, once the fan disk fails or the communication is abnormal, the operation of the entire outdoor equipment will be seriously affected, and may even cause the system to crash. Therefore, the flexibility and reliability of the traditional outdoor equipment control system are poor. Summary of the invention
[0003] The present invention provides a method, device and storage medium for matching an external device with multiple types of slaves, so as to solve the problem in the prior art that the flexibility and reliability of the control system of the external device are poor due to the limitation of the internal fan disk.
[0004] A first aspect of the present invention provides a method for matching an external device with multiple types of slaves, comprising: obtaining a software code corresponding to at least one slave; determining whether there is a candidate software code in at least one software code that matches a support list preset in the external device, the support list including code segments, identifiers or version numbers of software codes corresponding to multiple slave types; if so, filtering out a target software code from all candidate software codes; performing a mode conversion on the external device based on the slave type corresponding to the target software code to obtain an adapted device state.
[0005] In a feasible implementation, obtaining the software code corresponding to at least one slave includes: sending a target retrieval instruction, and if target data returned by at least one slave is received within a specified time, parsing the at least one target data and extracting the software code of the at least one slave.
[0006] In a feasible implementation manner, the determining whether there is a candidate software code in at least one software code that matches a support list preset in the external device includes: comparing all software codes one by one with the code segments included in the support list preset in the external device; in the support list, if a candidate software code with a completely identical code segment is found, determining that the candidate software code matches the support list and recording the candidate software code; in the support list, if no corresponding code segment is found for all software codes, determining that all software codes do not match the support list.
[0007] In a feasible implementation manner, the screening out of the target software code from all candidate software codes includes: determining the target software code from all candidate software codes through a weighted scoring mechanism based on the matching degree of the slave type, the current load condition of the external device, historical matching records and user preference settings.
[0008] In a feasible implementation manner, the target software code is determined from all candidate software codes through a weighted scoring mechanism based on the matching degree of the slave type, the current load condition of the external device, the historical matching records and the user preference settings, including: determining the matching degree between the slave type corresponding to each candidate software code and the requirements of the external device, and assigning a first score to each candidate code based on the matching result; checking the current load condition of the external device to determine whether the external device has sufficient processing power to support a new slave connection, and based on the historical matching records, evaluating the past performance and stability of the slave corresponding to each candidate software code, and assigning a second score to each candidate software code based on the judgment result and the evaluation result; reading the preferences set by the user in the external device, and assigning a third score to each candidate software code according to the user preference settings; and selecting the target software code from all candidate software codes through a weighted scoring mechanism based on the first score, the second score and the third score.
[0009] In a feasible implementation, the mode conversion of the external device based on the slave type corresponding to the target software code to obtain an adapted device state includes: determining the corresponding slave type based on the target software code; configuring the communication module of the external device accordingly according to the communication protocol requirements of the slave type; and adjusting the operating parameters of the external device accordingly according to the performance requirements and functional requirements of the slave type to obtain an adapted device state.
[0010] In a feasible implementation, after performing a mode conversion on the external device based on the slave type corresponding to the target software code to obtain the adapted device state, it also includes: based on the successful result of the mode conversion, memorizing and saving corresponding flag information in the external device as a basis for subsequent operation processes, and the flag information can be updated or changed to ensure that the external device can continue to adapt to different types of slaves.
[0011] The second aspect of the present invention provides a matching device for an external device and multiple types of slaves, including: an acquisition module, used to acquire a software code corresponding to at least one slave; a judgment module, used to judge whether there is a candidate software code in at least one software code that matches a support list preset in the external device, the support list including code segments, identifiers or version numbers of software codes corresponding to multiple slave types; a screening module, used to filter out a target software code from all candidate software codes if it exists; and a conversion module, used to perform a mode conversion on the external device based on the slave type corresponding to the target software code to obtain an adapted device state.
[0012] In a feasible implementation manner, the acquisition module is specifically used to: send a target retrieval instruction, and if target data returned by at least one slave is received within a specified time, parse the at least one target data and extract the software code of the at least one slave.
[0013] In a feasible implementation, the judgment module is specifically used to: compare all software codes one by one with the code segments included in a support list preset in the external device; in the support list, if a candidate software code with exactly the same code segment is found, it is determined that the candidate software code matches the support list and the candidate software code is recorded; in the support list, if no corresponding code segment is found for all software codes, it is determined that all software codes do not match the support list.
[0014] In a feasible implementation, the screening module includes: a determination unit for determining the target software code from all candidate software codes through a weighted scoring mechanism based on the hardware configuration of the slave, the current load of the current external device, historical matching records and user preference settings.
[0015] In a feasible implementation, the determination unit is specifically used to: evaluate the operating performance impact corresponding to the candidate software code based on the hardware configuration of the slave, and assign a first score to each candidate software code based on the evaluation result; check the current load of the current external device, determine whether the external device has sufficient processing power to support the new slave connection, and evaluate the past performance and stability of each candidate software code based on historical matching records, and assign a second score to each candidate software code based on the judgment result and the evaluation result; read the preferences set by the user in the external device, and assign a third score to each candidate software code according to the user preference setting; based on the first score, the second score and the third score, select the target software code from all candidate software codes through a weighted scoring mechanism.
[0016] In a feasible implementation, the conversion module is specifically used to: determine the corresponding slave type based on the target software code; configure the communication module of the external device accordingly according to the communication protocol requirements of the slave type; and adjust the operating parameters of the external device accordingly according to the performance requirements and functional requirements of the slave type to obtain an adapted device state.
[0017] In a feasible implementation manner, the matching device for the external device and multiple types of slaves also includes: a saving module, which is used to memorize and save corresponding flag information in the external device according to the successful result of the mode conversion, as a basis for subsequent operation processes, and the flag information can be updated or changed to ensure that the external device can continue to adapt to different types of slaves.
[0018] A third aspect of the present invention provides a computer device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes the above-mentioned method for matching an external device with multiple types of slaves.
[0019] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned method for matching an external device with multiple types of slaves.
[0020] In the technical solution provided by the present invention, a software code corresponding to at least one slave is obtained; it is determined whether there is a candidate software code in at least one software code that matches a support list preset in an external device, the support list including code segments, identifiers or version numbers of software codes corresponding to a plurality of slave types; if so, a target software code is screened out from all candidate software codes; and a mode conversion is performed on the external device based on the slave type corresponding to the target software code to obtain an adapted device state. In an embodiment of the present invention, by obtaining a slave software code and matching it with a support list preset in an external device, a mode conversion is performed on the external device after the target software code is screened out, thereby achieving flexible adaptation of the external device to a plurality of types of slaves, without relying on a specific hardware interface or communication protocol, significantly improving the flexibility and reliability of the system, and ensuring the normal operation of the external device and the overall stability of the system even in the face of changes or failures in the slave type. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic diagram of an embodiment of a method for matching an external device with multiple types of slave devices in an embodiment of the present invention;
[0022] Figure 2 It is a schematic diagram of another embodiment of a method for matching an external device with multiple types of slave devices in an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of an embodiment of a matching device for an external device and multiple types of slave devices in an embodiment of the present invention;
[0024] Figure 4 It is a schematic diagram of another embodiment of a matching device between an external device and multiple types of slave devices in an embodiment of the present invention;
[0025] Figure 5 FIG. 1 is a schematic diagram of an embodiment of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The embodiment of the present invention provides a method, device and storage medium for matching an external device with multiple types of slaves, which improves the flexible adaptation capability of the external device to different slaves and the reliability of system operation by matching and screening out target software codes and performing mode conversion.
[0027] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] It is understandable that the execution subject of the present invention may be a matching device between an external device and multiple types of slaves, or may be a terminal or a server, which is not specifically limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0029] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 In one embodiment of the present invention, a method for matching an external device with multiple types of slave devices includes:
[0030] 101. Obtain software code corresponding to at least one slave device;
[0031] Within the first 10 seconds after the external device is started, the server sends up to 3 retrieval instructions to the external environment at a baud rate of 4800. These instructions are equivalent to exploratory tentacles, aiming to establish communication connections with different types of slaves that may exist. After 10 seconds, the baud rate is switched to 9600, and up to 3 retrieval instructions are continued to be sent within 10 to 20 seconds. In this way, slave devices with different communication rates and protocols can be adapted. While sending instructions, the server continuously monitors feedback information from the slaves. Once the software code returned by at least one slave is received, this information is regarded as the basis for the subsequent matching process.
[0032] 102. Determine whether there is a candidate software code in at least one software code that matches a support list preset in the external device, where the support list includes code segments, identifiers or version numbers of software codes corresponding to multiple slave types;
[0033] Read and parse the preset support list from the external device, the support list contains a series of authenticated software code identifiers or version numbers, traverse the software code to be checked, and for each software code, use the string matching algorithm to compare one by one with each entry in the support list, and determine whether there is an entry in the support list that is exactly the same as the identifier or version number of any software code. If there is at least one completely matching entry, it is determined that there is at least one software code that matches the support list in the external device, and the matching software code is defined as a candidate software code. If there is no completely matching entry in the support list, it is determined that there is no matching candidate software code. Among them, the comparison method can use a hash table for fast search and comparison, use each software code identifier or version number in the support list as a key, build a hash table, traverse each software code to be checked, calculate the corresponding hash value for each software code, and find out whether there is the same key in the hash table. If there is the same key, it indicates that there is a matching candidate software code. If there is still no same key after traversing all software codes, it indicates that there is no matching candidate software code. If there is no matching candidate software code, the external device is controlled to automatically switch to the default multi-connection model.
[0034] 103. If it exists, select the target software code from all candidate software codes;
[0035] Define a clear screening criterion, which may include the functional requirements, compatibility requirements, performance indicators, security standards, and specific technical architecture corresponding to the software code. Use automated tools or scripts to analyze the candidate software code and extract metadata related to the screening criteria, such as the functional description of the code, the version of the dependent library, the performance test results, and the security audit report. Input the extracted metadata into the filter, evaluate and score the candidate software code according to predefined rules or trained models, and select the software code with the highest score or that meets a specific threshold as the target software code based on the scoring results. The filter can be a machine learning-based filter, which uses a large amount of metadata as training data to train a classification model that can learn the characteristic patterns of software codes that meet the screening criteria. After the training is completed, the model is applied to the screening of the target software code. By inputting the metadata of the candidate software code to be screened into the model, the model will output a prediction result, which is used to determine the target software code.
[0036] 104. Perform mode conversion on the external device based on the slave type corresponding to the target software code to obtain an adapted device state.
[0037] According to the slave type corresponding to the target software code, corresponding operations are performed on the external device, including but not limited to adjusting internal parameter settings, reconfiguring control logic, and updating communication protocols. For example, when the slave type is single floor heating mode, the external device will intelligently turn off many functions and control options related to multi-split, and activate functions closely related to single floor heating mode. For key parameters such as target temperature, start-up hysteresis, and shutdown hysteresis, the processing logic specially customized for single floor heating mode is used for fine regulation. In this way, the external device can ensure seamless connection and efficient collaboration with the slave.
[0038] In the embodiment of the present invention, by obtaining the slave software code and matching it with the preset support list of the external device, the mode of the external device is converted after the target software code is screened out, thereby achieving flexible adaptation of the external device to various types of slaves without relying on the information provided by the internal fan disk, thereby improving the flexibility and reliability of the system, and even in the face of changes or failures in the slave type, the normal operation of the external device and the overall stability and reliability of the system can be ensured.
[0039] See also Figure 2 Another embodiment of the method for matching an external device with multiple types of slaves in the embodiment of the present invention includes:
[0040] 201. Obtain software code corresponding to at least one slave machine;
[0041] A target search instruction is sent, and if target data returned by at least one slave is received within a specified time, the at least one target data is parsed and the software code of at least one slave is extracted.
[0042] When the server performs the retrieval task of the external device, it will actively send a series of pre-designed target retrieval instructions to the slave devices in the network environment. The target retrieval instructions follow the general communication protocol and format, aiming to cover and effectively identify a variety of different types of slave devices. The server then starts a timing mechanism to monitor the response time after the instruction is issued. If the server successfully receives the target data returned by at least one slave within the preset time range, the data parsing function module will be activated immediately. The parsing module is responsible for decoding and formatting the received data and extracting the slave's software code from it. These software codes record in detail the key identifiers such as the type, version information, and functional characteristics of the slave. Among them, the preset time range can be set to 5 seconds, 10 seconds, etc., and the specific time is adjusted according to the network delay and the response speed of the slave device.
[0043] 202. Determine whether there is a candidate software code in at least one software code that matches a support list preset in the external device, where the support list includes code segments, identifiers or version numbers of software codes corresponding to multiple slave types;
[0044] In a complex multi-slave environment, when faced with multiple slaves with the same software version number but slight functional differences, identifiers can be used to quickly distinguish and determine their compatibility with external devices. Identifiers are a unique piece of information embedded in the slave software code that is used to identify a specific version or functional feature of the software. In a complex slave environment, a series of identifiers can be designed, each of which corresponds to one or more specific functions of the slave, such as advanced control functions, communication protocol support, data processing capabilities, etc. When the slave software code is received, the identifier is parsed and compared with the preset support list. The support list contains identifiers corresponding to multiple slave types and their compatibility information. By comparing the identifiers, it can be quickly determined whether the slave supports the functional features required by the external device. For example, there are slaves A and B, and the software version numbers of slaves A and B are the same, but slave A supports advanced control functions while slave B does not. In this case, the identifier of slave A may contain a string such as "ADV_CTRL_SUP", indicating that it supports advanced control functions, while the identifier of slave B does not contain such a string. When the external device receives the software codes of the two slaves, it will parse the identifiers and check whether it contains "ADV_CTRL_SUP". If the external device itself also has the ability to process advanced control functions, it will choose to match slave A; otherwise, it will choose to match slave B or continue to search for other candidate slaves. In this way, a slave that matches the needs of the external device itself can be selected more intelligently, thereby improving the overall performance and stability of the system.
[0045] All software codes are compared one by one with the code segments contained in the support list preset in the external device; in the support list, if a candidate software code with exactly the same code segment is found, it is determined that the candidate software code matches the support list and the candidate software code is recorded; in the support list, if no corresponding code segment is found for all software codes, it is determined that all software codes do not match the support list.
[0046] In the process of software compatibility judgment, when it is necessary to ensure the precise match between the software code and the external device, especially when it comes to core parts such as the underlying communication protocol, key functional modules or specific algorithm implementations, the comparison mainly relies on code segments. This method can directly check the implementation details of the code, thereby accurately judging whether the software meets the compatibility requirements of the external device. For example, when the slave software has undergone a major functional update, such as adding support for a new communication protocol or optimizing the data processing algorithm, but its version number has not changed for compatibility reasons, it is impossible to determine whether the updated software can be supported by the external device based solely on the version number. At this time, it is necessary to go deep into the code level and determine the compatibility by comparing the code segments corresponding to the key functional modules. For example, if the updated slave software has added support for an efficient data transmission protocol, it is possible to confirm whether the external device can recognize and correctly respond to these new communication instructions by finding and comparing the code segments of the protocol implementation part. Similarly, when the new slave software is developed based on the same basic framework but has expanded its functions for different application scenarios, it can also be identified by specific code segments whether it belongs to a type that can be adapted by the external device. For example, if the external device needs to support a slave with a specific data analysis function, it can be checked whether the slave software contains a specific code segment that implements the function, thereby quickly determining whether it meets the adaptation requirements.
[0047] The comparison method can be implemented using a data structure and algorithm based on a binary search tree (BST). Specifically, the support list preset in the external device can be converted into a highly balanced binary search tree, in which each node stores a code segment of a software code, and satisfies the value of all nodes in the left subtree is less than the value of the root node, and the value of all nodes in the right subtree is greater than the value of the root node. In this way, by constructing a highly balanced BST, it can be ensured that a single search operation is completed within the time complexity of O(log n), where n is the number of software codes in the support list, and the software codes to be checked are traversed. For each software code, it is used as a query value and searched in the BST. If there is a node in the BST that is equal to the query value, it indicates that there is a matching candidate software code. If no matching node is found after traversing the entire list, it is determined that there is no matching candidate software code. In this comparison method, only when the code segment in the software code to be checked is completely equal to the code segment stored in the BST at the byte level will it be considered as a matching candidate software code. Therefore, the BST-based comparison method ensures a high degree of matching accuracy and reliability.
[0048] 203. If so, determine the target software code from all candidate software codes through a weighted scoring mechanism based on the matching degree of the slave type, the current load of the external device, the historical matching records, and the user preference settings;
[0049] Determine the degree of match between the slave type corresponding to each candidate software code and the requirements of the external device, and assign a first score to each candidate code based on the matching result; check the current load of the external device, determine whether the external device has sufficient processing power to support the new slave connection, and evaluate the past performance and stability of the slave corresponding to each candidate software code based on historical matching records, and assign a second score to each candidate software code based on the judgment result and the evaluation result; read the preferences set by the user in the external device, and assign a third score to each candidate software code according to the user preference setting; based on the first score, the second score and the third score, select the target software code from all candidate software codes through a weighted scoring mechanism.
[0050] A feature comparison algorithm can be used to compare the key characteristics of the slave type represented by each candidate software code with the requirements of the external device item by item. The comparison content includes communication protocols, interface standards, data processing capabilities, etc., so as to quantify the degree of match between them. Based on the evaluation result of this degree of match, a first score is assigned to each candidate software code. The level of the first score directly reflects its fit with the requirements of the external device. The higher the score, the better the match.
[0051] Real-time monitoring technology is used to continuously track the current load of the external device, and key indicators such as CPU usage, memory occupancy and network bandwidth are used to determine whether it has sufficient remaining processing power to support new slave connections. At the same time, combined with the records in the historical matching database, the performance and stability data of the slave corresponding to each candidate software code when it cooperated with the external device in the past, such as failure rate, response time, etc., are analyzed. Based on the judgment results and evaluation and analysis results, a second score is assigned to each candidate software code. The second score takes into account the current processing capacity of the external device and also reflects the historical performance and stability of the candidate slave.
[0052] Read the preference settings configured by the user on the external device, including but not limited to performance requirements, stability requirements, functional characteristics preferences, etc. Through the preset preference evaluation algorithm, each candidate software code is evaluated one by one according to the preference weight and priority defined by the user to determine the degree to which it meets the user's preferences. Based on the evaluation results, a third score is calculated and assigned to each candidate software code. The third score comprehensively reflects the degree of match between the candidate software code and the user's preferences. The higher the score, the better the match, thereby ensuring that the software code finally selected can be closest to the user's actual needs.
[0053] The three scores of each candidate software code are weighted and summed according to the preset weight ratio to obtain the comprehensive score of each candidate code. By comparing the comprehensive scores of all candidate codes, the candidate software code with the highest score is selected as the target software code to ensure that the final selected software code is the most suitable in terms of matching degree, adaptability to device processing capabilities and satisfaction of user preferences.
[0054] Specifically, based on a preset weight ratio, a first weight is assigned to the first score, a second weight is assigned to the second score, and a third weight is assigned to the third score. The weighted calculation formula for the comprehensive score is: S=(S1×W1)+(S2×W2)+(S3×W3), wherein S is the comprehensive score, S1 is the first score, S2 is the second score, S3 is the third score, W1 is the first weight, W2 is the second weight, and W3 is the third weight.
[0055] For example, suppose there are two candidate software codes A and B, and their three scores and preset weight ratios are as follows: Candidate code A: S1 = 80, S2 = 70, S3 = 90; Candidate code B: S1 = 75, S2 = 85, S3 = 80; preset weight ratios: W1 = 0.4, W2 = 0.3, W3 = 0.3. According to the weighted calculation formula, the comprehensive scores of candidate codes A and B can be calculated: Comprehensive score of candidate code A: SA = (80 × 0.4) + (70 × 0.3) + (90 × 0.3) = 32 + 21 + 27 = 80; Comprehensive score of candidate code B: SB = (75 × 0.4) + (85 × 0.3) + (80 × 0.3) = 30 + 25.5 + 24 = 79.5. By comparison, it can be concluded that the comprehensive score of candidate code A is higher than that of candidate code B. Therefore, candidate code A is selected as the target software code to ensure that the final selected software code is the most appropriate in terms of matching degree, adaptability of device processing capabilities and satisfaction of user preferences.
[0056] 204. Performing mode conversion on the external device based on the slave type corresponding to the target software code to obtain an adapted device state;
[0057] Determine the corresponding slave type based on the target software code; configure the communication module of the external device accordingly according to the communication protocol requirements of the slave type; adjust the operating parameters of the external device accordingly according to the performance requirements and functional requirements of the slave type to obtain the adapted device status.
[0058] Determine the slave type corresponding to the target software code, clarify its communication protocol requirements, and configure the communication module of the external device according to the communication protocol of the slave type, including setting the correct communication port, baud rate, data format, etc., to ensure smooth and error-free communication between the external device and the slave; further, according to the performance requirements and functional requirements of the slave type, make detailed adjustments to the operating parameters of the external device, such as optimizing the CPU frequency, adjusting memory allocation, setting specific functional modes, etc., to obtain the best adaptation effect. After this series of configurations and adjustments, the external device will be adjusted to a state that is highly matched with the selected slave type, ensuring that the two can work together efficiently.
[0059] 205. According to the successful result of the mode conversion, the corresponding flag information is memorized and saved in the external device as a basis for the subsequent operation process. The flag information can be updated or changed to ensure that the external device can continue to adapt to different types of slaves.
[0060] After the adaptation is successfully completed, an encrypted storage area is created in the non-volatile memory of the external device, and the Advanced Encryption Standard (AES) is used to securely save the flag information of successful adaptation. This information includes the slave type identification, communication protocol configuration details, operating parameter settings, etc., and is stored in a structured data format for fast reading and parsing. In order to ensure that the device can flexibly adapt to different types of slaves in the future, this mechanism allows the stored flag information to be updated or changed when necessary through the configuration management tool. The tool provides a user interface that allows administrators to easily view, modify and update the flag information without directly accessing the underlying storage device. In addition, the configuration management tool also has The function of automatically detecting the connection status between the external device and the slave can trigger the re-adaptation process immediately once the connection is detected to be disconnected or changed. At the same time, a version control mechanism is introduced to add a timestamp and version number to the logo information generated for each adaptation to facilitate tracking and rollback. Before and after updating the logo information, the automated testing module in the configuration management tool will automatically run a series of test cases to verify the correctness and stability of the adaptation. The event-driven architecture is adopted to ensure that the external device can respond to changes in the slave type or communication failures in real time, and dynamically adjust based on the latest user preferences and system status to always maintain the best adaptation state, thereby greatly improving the flexibility and scalability of the external device.
[0061] In an embodiment of the present invention, by obtaining the software code corresponding to at least one slave machine, determining the candidate software code in the preset support list of the external device, and comprehensively considering the slave type matching degree, device load, historical matching records and user preferences, a weighted scoring mechanism is used to optimize the target software code for mode conversion, and after successful adaptation, the updateable flag information is saved, which effectively improves the flexible adaptation capability and operating efficiency of the external device to a variety of slave machines, ensures the continuous and stable operation of the device and meets the personalized needs of users.
[0062] The above describes the matching method between the external device and the multiple types of slaves in the embodiment of the present invention. The following describes the matching device between the external device and the multiple types of slaves in the embodiment of the present invention. Figure 3 In one embodiment of the present invention, an embodiment of a matching device for an external device and multiple types of slave devices includes:
[0063] An acquisition module 301 is used to acquire software code corresponding to at least one slave;
[0064] A determination module 302 is used to determine whether there is a candidate software code in at least one software code that matches a support list preset in the external device, the support list including code segments, identifiers or version numbers of software codes corresponding to multiple slave types;
[0065] A screening module 303 is used to screen out the target software code from all candidate software codes if it exists;
[0066] The conversion module 304 is used to perform mode conversion on the external device based on the slave type corresponding to the target software code to obtain an adapted device state.
[0067] In the embodiment of the present invention, by obtaining the slave software code and matching it with the preset support list of the external device, the mode of the external device is converted after the target software code is screened out, thereby achieving flexible adaptation of the external device to various types of slaves without relying on the information provided by the internal fan disk, significantly improving the flexibility and reliability of the system, and even in the face of changes or failures in the slave type, the normal operation of the external device and the overall stability and reliability of the system can be ensured.
[0068] See also Figure 4 Another embodiment of the matching device between an external device and multiple types of slaves in the embodiment of the present invention includes:
[0069] An acquisition module 301 is used to acquire software code corresponding to at least one slave;
[0070] A determination module 302 is used to determine whether there is a candidate software code in at least one software code that matches a support list preset in the external device, the support list including code segments, identifiers or version numbers of software codes corresponding to multiple slave types;
[0071] A screening module 303 is used to screen out the target software code from all candidate software codes if it exists;
[0072] The conversion module 304 is used to perform mode conversion on the external device based on the slave type corresponding to the target software code to obtain an adapted device state.
[0073] Optionally, the acquisition module 301 may be specifically used for:
[0074] A target search instruction is sent, and if target data returned by at least one slave is received within a specified time, the at least one target data is parsed and the software code of at least one slave is extracted.
[0075] Optionally, the determination module 302 may be specifically configured to:
[0076] All software codes are compared one by one with the code segments contained in the support list preset in the external device; in the support list, if a candidate software code with exactly the same code segment is found, it is determined that the candidate software code matches the support list and the candidate software code is recorded; in the support list, if no corresponding code segment is found for all software codes, it is determined that all software codes do not match the support list.
[0077] Optionally, the screening module 303 includes:
[0078] The determination unit 3031 is used to determine the target software code from all candidate software codes through a weighted scoring mechanism according to the matching degree of the slave type, the current load condition of the external device, the historical matching records and the user preference settings.
[0079] Optionally, the determining unit 3031 may be specifically configured to:
[0080] Determine the degree of match between the slave type corresponding to each candidate software code and the requirements of the external device, and assign a first score to each candidate code based on the matching result; check the current load of the external device, determine whether the external device has sufficient processing power to support the new slave connection, and evaluate the past performance and stability of the slave corresponding to each candidate software code based on historical matching records, and assign a second score to each candidate software code based on the judgment result and the evaluation result; read the preferences set by the user in the external device, and assign a third score to each candidate software code according to the user preference setting; based on the first score, the second score and the third score, select the target software code from all candidate software codes through a weighted scoring mechanism.
[0081] Optionally, the conversion module 304 may be specifically configured to:
[0082] Determine the corresponding slave type based on the target software code; configure the communication module of the external device accordingly according to the communication protocol requirements of the slave type; adjust the operating parameters of the external device accordingly according to the performance requirements and functional requirements of the slave type to obtain the adapted device status.
[0083] Optionally, the matching device for the external device and the multiple types of slave devices further includes:
[0084] The saving module 305 is used to memorize and save the corresponding flag information in the external device according to the successful result of the mode conversion, so as to serve as the basis for the subsequent operation process. The flag information can be updated or changed to ensure that the external device can continue to adapt to different types of slaves.
[0085] In an embodiment of the present invention, by obtaining the software code corresponding to at least one slave machine, determining the candidate software code in the preset support list of the external device, and comprehensively considering the slave type matching degree, device load, historical matching records and user preferences, a weighted scoring mechanism is used to optimize the target software code for mode conversion, and after successful adaptation, the updateable flag information is saved, which effectively improves the flexible adaptation capability and operating efficiency of the external device to a variety of slave machines, ensures the continuous and stable operation of the device and meets the personalized needs of users.
[0086] above Figure 3 and Figure 4 The matching device between the external device and multiple types of slaves in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The computer device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0087] See also Figure 5 As shown, the computer device includes a processor 500 and a memory 501 . The memory 501 stores machine executable instructions that can be executed by the processor 500 . The processor 500 executes the machine executable instructions to implement the above-mentioned matching method between the external device and multiple types of slaves.
[0088] Further, Figure 5 The computer device shown further includes a bus 502 and a communication interface 503 , and the processor 500 , the communication interface 503 and the memory 501 are connected via the bus 502 .
[0089] Among them, the memory 501 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), for example, at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 503 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 502 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0090] The processor 500 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 500. The above processor 500 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 501 , and the processor 500 reads the information in the memory 501 and completes the method steps of the above-mentioned embodiment in combination with its hardware.
[0091] The present invention also provides a computer device, the computer device includes a memory and a processor, the memory stores computer-readable instructions, when the computer-readable instructions are executed by the processor, the processor executes the steps of the method for matching the external device with multiple types of slaves in the above embodiments. The present invention also provides a computer-readable storage medium, the computer-readable storage medium can be a non-volatile computer-readable storage medium, the computer-readable storage medium can also be a volatile computer-readable storage medium, the computer-readable storage medium stores instructions, when the instructions are executed on the computer, the computer executes the steps of the method for matching the external device with multiple types of slaves.
[0092] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0093] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0094] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for matching an external device with multiple types of slave devices, characterized in that: The matching method between the external device and the slave device includes: Obtaining software code corresponding to at least one slave; Determine whether there is a candidate software code in at least one software code that matches a support list preset in the external device, wherein the support list includes code segments, identifiers or version numbers of software codes corresponding to multiple slave types; If it exists, the target software code is selected from all candidate software codes; The mode of the external device is converted based on the slave type corresponding to the target software code to obtain an adapted device state.
2. The method for matching an external device with multiple types of slave devices according to claim 1, characterized in that: The obtaining of software code corresponding to at least one slave device includes: A target search instruction is sent, and if target data returned by at least one slave is received within a specified time, the at least one target data is parsed and the software code of the at least one slave is extracted.
3. The method for matching an external device with multiple types of slave devices according to claim 1, characterized in that: The determining whether there is a candidate software code in the at least one software code that matches a support list preset in the external device includes: Compare all software codes with the code segments included in the preset support list in the external device one by one; If a candidate software code having a completely identical code segment is found in the support list, determining that the candidate software code matches the support list and recording the candidate software code; In the support list, if no corresponding code segment is found for all software codes, it is determined that all software codes do not match the support list.
4. The method for matching an external device with multiple types of slave devices according to claim 1, characterized in that: The step of selecting the target software code from all candidate software codes includes: The target software code is determined from all candidate software codes through a weighted scoring mechanism according to the matching degree of the slave type, the current load condition of the external device, the historical matching records and the user preference settings.
5. The method for matching an external device with multiple types of slave devices according to claim 4, characterized in that: The method of determining the target software code from all candidate software codes through a weighted scoring mechanism based on the matching degree of the slave type, the current load of the external device, the historical matching records and the user preference settings includes: Determine the degree of matching between the slave machine type corresponding to each candidate software code and the external machine device requirement, and assign a first score to each candidate code based on the matching result; Check the current load of the external device to determine whether the external device has sufficient processing capacity to support the connection of a new slave, and evaluate the past performance and stability of the slave corresponding to each candidate software code based on historical matching records, and assign a second score to each candidate software code based on the determination result and the evaluation result; reading preferences set by a user in the external device, and assigning a third score to each candidate software code according to the user preferences; Based on the first score, the second score and the third score, a target software code is selected from all candidate software codes through a weighted scoring mechanism.
6. The method for matching an external device with multiple types of slave devices according to claim 1, characterized in that: The mode conversion of the external device based on the slave type corresponding to the target software code to obtain an adapted device state includes: Determining a corresponding slave type based on the target software code; According to the communication protocol requirements of the slave type, the communication module of the external device is configured accordingly; According to the performance requirements and functional requirements of the slave type, the operating parameters of the external device are adjusted accordingly to obtain an adapted device state.
7. The method for matching an external device with multiple types of slave devices according to claim 1, characterized in that: After the mode of the external device is converted based on the slave type corresponding to the target software code to obtain the adapted device state, the method further includes: According to the successful result of the mode conversion, the corresponding flag information is memorized and saved in the external device as a basis for the subsequent operation process. The flag information can be updated or changed to ensure that the external device can continue to adapt to different types of slaves.
8. A matching device for an external device and multiple types of slave devices, characterized in that: The matching device of the external device and the multiple types of slave devices includes: An acquisition module, used for acquiring software code corresponding to at least one slave; A determination module, configured to determine whether there is a candidate software code in at least one software code that matches a support list preset in the external device, wherein the support list includes code segments, identifiers or version numbers of software codes corresponding to multiple slave types; A screening module, for screening out the target software code from all candidate software codes if any; The conversion module is used to perform mode conversion on the external device based on the slave type corresponding to the target software code to obtain an adapted device state.
9. A computer device, characterized in that: The computer device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instruction in the memory to enable the computer device to execute the method for matching an external device with multiple types of slaves as described in any one of claims 1 to 7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the method for matching an external device with multiple types of slaves as described in any one of claims 1 to 7 is implemented.