Dry contact configuration method and device and power supply equipment thereof
By receiving and computing dry contact configuration instructions, dynamically configuring dry contact functions and levels, the problems of cumbersome configuration of dry contacts and high maintenance costs are solved, and flexible system adaptability and simplified configuration process are achieved.
Patent Information
- Application Number
- CN202511006535.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-07-22
AI Technical Summary
In the prior art, the functions and level configuration of dry contacts are relatively fixed, making it difficult to flexibly adjust according to different project needs, resulting in cumbersome configuration, delayed response and high maintenance costs.
By receiving configuration instructions containing the dry contact function bit identification and the effective level identification, and determining the target level based on logical operations, dynamic configuration of input/output dry contact functions and levels is realized, and setting is simplified by using a graphical interface.
It improves the flexibility and adaptability of the system, simplifies the on-site debugging and maintenance process, meets the diverse needs in different application scenarios, and improves the universality and scalability of the system.
Smart Images

Figure CN120546293A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electrical technology, and in particular to a dry contact configuration method, device, and power supply equipment thereof. Background Art
[0002] Dry contacts are a common signal interface used in industrial control and automation systems, typically indicating switch states or device trigger conditions. They are passive, low-power, and highly resistant to interference, making them widely used in various communication scenarios, including sensors, relays, and safety interlocks. In practical applications, flexible control logic requires the configuration of multiple dry contacts to accommodate diverse input and output requirements.
[0003] In related technologies, the function and level relationship of dry contacts are generally defined through hardware jumpers or fixed settings. However, when faced with complex or changeable dry contact application scenarios, there are problems such as cumbersome configuration, response delays, and high maintenance costs. Summary of the Invention
[0004] One of the purposes of this application is to provide a dry contact configuration method, device and power supply equipment thereof to solve the problems of cumbersome configuration, response delay and high maintenance cost in the related art when facing complex or changeable dry contact application scenarios.
[0005] In order to achieve the above-mentioned purpose, the technical solution of the embodiment of the present application is implemented as follows: In a first aspect, an embodiment of the present application provides a dry contact configuration method, the method comprising: Receive a dry contact configuration instruction; wherein the dry contact configuration instruction includes configuration information and a first level corresponding to at least one dry contact, and the configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the dry contact; For each dry contact, a first logic operation is performed based on the valid level identifier and the first level to determine a target level of the dry contact, and the target level is stored in a storage address corresponding to the dry contact function bit identifier.
[0006] In a second aspect, an embodiment of the present application provides a dry contact configuration device, the device comprising: A receiving module, configured to receive a dry contact configuration instruction; wherein the dry contact configuration instruction includes configuration information and a first level corresponding to at least one dry contact, and the configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the dry contact; The processing module is used to perform a first logic operation on each dry contact based on the effective level identifier and the first level, determine the target level of the dry contact, and store the target level in a storage address corresponding to the dry contact function bit identifier.
[0007] In a third aspect, an embodiment of the present application provides a power supply device, the power supply device comprising: at least one processor; and, A memory communicatively connected to at least one processor; wherein the memory stores a computer program executable by at least one processor, and the computer program is executed by at least one processor to implement some or all of the steps in the dry contact configuration method of the first aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement some or all of the steps in the dry contact configuration method of the first aspect.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements some or all of the steps in the dry contact configuration method of the first aspect.
[0010] The embodiment of the present application provides a dry contact configuration method, apparatus, and power supply device thereof, comprising: receiving a dry contact configuration instruction; wherein the dry contact configuration instruction includes configuration information and a first level corresponding to at least one dry contact, the configuration information including at least a dry contact function bit identifier and an effective level identifier corresponding to the dry contact; for each dry contact, performing a first logical operation based on the effective level identifier and the first level to determine a target level for the dry contact, and storing the target level in a storage address corresponding to the dry contact function bit identifier. In this way, by receiving the dry contact configuration instruction including the configuration information and the first level, and performing the first logical operation based on the effective level identifier and the first level on each dry contact to generate a target level and store it in a corresponding storage address, this method allows the number and function of input / output dry contacts in different projects to be flexibly configured, thereby improving the adaptability and scalability of the system and resolving the problem in traditional solutions of fixed dry contact functions and difficulty in adapting to various application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to illustrate the technical solutions of the present application.
[0012] Figure 1 A schematic diagram of an optional dry contact configuration method provided in an embodiment of the present application Figure 1 ; Figure 2A schematic diagram of an interface for configuring multiple input dry contacts on an optional input dry contact configuration interface provided in an embodiment of the present application; Figure 3 A schematic diagram of an interface for configuring multiple output dry contacts on an optional output dry contact configuration interface provided in an embodiment of the present application; Figure 4 A schematic diagram of a process for storing the functional logic level of an optional input dry contact provided in an embodiment of the present application; Figure 5 A schematic diagram of a process for storing an optional control level of an output dry contact provided in an embodiment of the present application; Figure 6 A schematic diagram of an optional dry contact configuration method provided in an embodiment of the present application Figure 2 ; Figure 7 A schematic diagram of an optional dry contact configuration method provided in an embodiment of the present application Figure 3 ; Figure 8 A structural block diagram of an optional input dry contact configuration method provided in an embodiment of the present application; Figure 9 A structural block diagram of an optional method for configuring output dry contacts provided in an embodiment of the present application; Figure 10 A flowchart of an optional input dry contact configuration method provided in an embodiment of the present application; Figure 11 A flowchart of an optional output dry contact configuration method provided in an embodiment of the present application; Figure 12 An optional process for defining configuration information of different types of dry contacts provided in an embodiment of the present application; Figure 13 A schematic structural diagram of an optional dry contact configuration device provided in an embodiment of the present application; Figure 14 A schematic structural diagram of an optional power supply device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions of this application are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0014] In the following description, references to "some embodiments" describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that the specific order or sequence of "first / second / third" may be interchanged where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0015] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing this application only and are not intended to limit this application.
[0016] With the development of industrial automation and power electronics, dry contacts, as a common form of input / output signaling, are widely used in various power supply devices and control systems. Traditionally, dry contact functions and level configurations are relatively fixed, making them difficult to flexibly adjust to meet diverse project requirements. For example, some systems may require a dry contact to be configured as an Emergency Power Off (EPO) function with a high-level active state, while other systems may require the same dry contact to be used for battery grounding failures with a low-level active state. Due to the lack of a unified configuration mechanism, existing technologies often rely on hardware or rigid software logic, resulting in high development costs, difficult maintenance, and poor adaptability.
[0017] To address the aforementioned issues, embodiments of the present application provide a dry contact configuration method. This method dynamically configures the input / output dry contact functions and levels by receiving a configuration instruction containing a dry contact function bit identifier and an effective level identifier, and determining the target level based on logical operations. This method not only enhances system flexibility but also allows users to conveniently set dry contact functions and effective levels through a graphical interface (e.g., a touchscreen), meeting the diverse needs of different application scenarios.
[0018] Figure 1 This is an optional flow chart of the dry contact configuration method provided in the embodiment of the present application. Figure 1 It should be noted that, Figure 1The dry contact configuration method described in this article uses an electronic control unit (ECU) as an example. This ECU can be an industrial controller, a programmable logic controller (PLC), a power supply, or other embedded system with input and output interfaces. In practice, users can configure the dry contact function and active level via a touchscreen interface. This configuration information is then transmitted to the ECU via a communication bus or internal registers for processing.
[0019] Step 101: Receive a dry contact configuration instruction; wherein the dry contact configuration instruction includes configuration information and a first level corresponding to at least one dry contact, and the configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the dry contact.
[0020] In the embodiments of the present application, dry contacts can be passive switch input / output interfaces, commonly used to indicate a certain status (such as fault, startup, etc.). They do not have their own power supply and only reflect changes in the status of external devices. Dry contacts can be input (reflecting external signals) or output (controlling external devices).
[0021] In the embodiments of the present application, the dry contact function bit identifier is used to identify the specific function corresponding to a dry contact in the system, such as EPO, battery grounding abnormality, mains switch disconnected, maintenance bypass switch closed, battery discharge prohibited, bypass switch disconnected, battery charging prohibited, mains abnormality, inverter abnormality, bypass power supply, battery power supply, bypass abnormality, battery circuit abnormality, uninterruptible power supply (UPS) abnormality, etc. The function bit identifier is typically represented in the form of a digital code and mapped to a specific memory address or register bit.
[0022] In this embodiment of the present application, the effective level identifier may be an identifier of the effective level value corresponding to when the dry contact is in an activated state. The effective level value may be a high level (High) or a low level (Low). The effective level value determines the state in which the dry contact is recognized as triggered or effective by the system.
[0023] In an embodiment of the present application, a dry contact configuration instruction includes configuration information and a first level corresponding to at least one dry contact, wherein the first level can be a detection level, or a functional logic level, and the first level is different for dry contacts of different types (including input type and output type). Each configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the dry contact. The configuration information can be transmitted in a standard data format, such as a 16-bit unsigned integer (Uint16) type of data; here, the lower 8 bits of the configuration information can be used to indicate the dry contact function bit identifier, and the highest bit is used to indicate the valid level identifier of the dry contact; of course, the upper 8 bits of the configuration information can be used to indicate the dry contact function bit identifier, and the lowest bit is used to indicate the valid level identifier of the dry contact. This application does not impose any specific restrictions on this.
[0024] For example, if a dry contact is configured as EPO and active high, its configuration information can be 0x8003, where 0x03 represents the dry contact function bit identifier, and the highest bit in 0x80 indicates that the active level is high. The dry contact function bit identifier refers to the specific function corresponding to the dry contact in the system, such as EPO or battery grounding anomaly. Each function bit identifier is mapped to a specific storage address or register bit for subsequent logical judgment and status writing.
[0025] In some embodiments, the dry contact configuration instruction in step 101 is generated based on the user's touch operation on the dry contact configuration interface, and the dry contact configuration interface includes parameters corresponding to the function bits and effective level identifiers of the dry contact function bit identifiers of multiple dry contacts.
[0026] In the embodiments of this application, the dry contact configuration interface refers to a graphical user interface provided via a touch screen or other touch-sensitive device for configuring the specific function and active level status of each dry contact. This interface typically displays information about each dry contact in a table or list format, such as its number, function name (e.g., EPO, bypass, etc.), input / output type, and active level selection (high or low).
[0027] In the embodiments of this application, a function bit refers to a binary bit used within the system to indicate whether a dry contact is activated or has a certain function. For example, in a 16-bit register, if the lower eight bits are set to the coded information corresponding to a certain function, it means that the dry contact is currently enabled or performing a specific function. The function bit is directly related to the functional logic of the dry contact and determines its behavior within the system.
[0028] In this embodiment of the present application, the valid level indicator refers to the level state (high or low) specified by the user in the configuration interface, which is used to determine the conditions under which the dry contact will be recognized as valid by the system. For example, if the user sets a dry contact as valid at a high level, the system will only consider it a valid signal and trigger the corresponding functional logic when the voltage of the dry contact is detected to be high.
[0029] In the embodiment of the present application, the dry contact configuration instruction can be an input dry contact configuration instruction or an output dry contact configuration instruction. If the dry contact configuration instruction is an input dry contact configuration instruction, the first level can be the detection level of the function corresponding to the input dry contact; if the dry contact configuration instruction is an output dry contact configuration instruction, the first level can be the functional logic level of the function corresponding to the output dry contact.
[0030] Dry contact configuration instructions are a set of configuration information generated by the user through the dry contact configuration interface corresponding to the dry contact type. Dry contact types include input dry contacts and output dry contacts. This configuration information is usually stored in the form of Uint16, where the lower 8 bits represent the dry contact function type code, and the highest bit indicates the active level status of the dry contact (high level is 1, low level is 0).
[0031] In one possible scenario, refer to Figure 2 As shown, Figure 2 This is a schematic diagram of an interface for configuring multiple input dry contacts on the input dry contact configuration interface. For an input dry contact located at channel number 2, it is configured as EPO, with a high level valid. The configuration information (also known as a configuration code) corresponding to this input dry contact is 0x8003. Based on the channel number (channel number = 2) where the input dry contact is located, the target level subsequently obtained through the first logic operation is stored in the storage address of the register corresponding to the function identification bit of the input dry contact. For an input dry contact located at channel number 3, it is configured as battery grounding abnormality, with a low level valid. The configuration information (also known as a configuration code) corresponding to this input dry contact is 0x0006. Based on the channel number (channel number = 3) where the input dry contact is located, the target level subsequently obtained through the first logic operation is stored in the storage address of the register corresponding to the function identification bit of the input dry contact.
[0032] In another possible scenario, refer to Figure 3 As shown, Figure 3This is a schematic diagram of the interface for configuring multiple output dry contacts on the output dry contact configuration interface. For the output dry contact with channel number 5, it is configured to be battery-powered and active at a high level. The configuration information (also known as the configuration code) corresponding to this input dry contact is 0x8003. Based on the channel number (channel number = 5) where this output dry contact is located, the target level obtained through the first logic operation is stored at the storage address in the register corresponding to the function identification bit of the output dry contact. For the output dry contact with channel number 8, it is configured to be UPS abnormal and active at a low level. The configuration information (also known as the configuration code) corresponding to this input dry contact is 0x0006. Based on the channel number (channel number = 8) where this output dry contact is located, the target level obtained through the first logic operation is stored at the storage address in the register corresponding to the function identification bit of the output dry contact.
[0033] It should be noted that the output dry contacts and the input dry contacts correspond to different registers, that is, the storage addresses are different.
[0034] In actual applications, users can use the touch screen to enter the dry contact configuration interface corresponding to different dry contact types, such as the input dry contact configuration interface or the output dry contact configuration interface. In this interface, they can select one or more dry contact channels and assign a function type and effective level to each dry contact channel. This generates configuration information for each dry contact based on the user's operation and saves this configuration information to memory or registers. Furthermore, the first level (also known as the input level) corresponding to each dry contact is obtained, such as the detection level corresponding to the input dry contact or the functional logic level corresponding to the output dry contact, thereby generating a dry contact configuration instruction for multiple dry contacts for subsequent input / output logic processing. This not only improves the flexibility of the system but also simplifies on-site debugging and maintenance.
[0035] As can be seen from the above, the embodiments of the present application provide a graphical dry contact configuration interface, allowing users to flexibly define the function of each dry contact and its effective level status. This allows for rapid adaptation to different project requirements, thereby improving the system's versatility and scalability, and further enhancing the overall automation control level and user experience.
[0036] Step 102 : For each dry contact, perform a first logic operation based on the valid level identifier and the first level to determine a target level of the dry contact, and store the target level in a storage address corresponding to the dry contact function bit identifier.
[0037] In an embodiment of the present application, the target level may refer to the final level value obtained after a logical operation, and the target level may be written into the storage address corresponding to the dry contact function bit identifier to indicate the current functional logic state of the dry contact.
[0038] In an embodiment of the present application, the first logical operation may be a logical operation performed based on the valid level indicator and a first level (e.g., a detection level or a functional logic level) to determine whether the actual state of the dry contact meets a preset condition. The first logical operation may be an exclusive OR (XOR) followed by a NOT (notation) logical operation, which can accurately determine whether the dry contact is in the expected valid state.
[0039] In an embodiment of the present application, after the electronic control unit receives the configuration information corresponding to at least one dry contact and the dry contact configuration instruction of the first level, for each dry contact, based on the valid level identifier in the configuration information and the input first level, performs an exclusive OR and then inverted logical operation to determine the target level of the dry contact, and stores the target level in the storage address in the register corresponding to the dry contact function bit identifier carried in the configuration information.
[0040] In some embodiments, the dry contact function bit identifier is represented by a first number of bits, and the process of storing the target level to the storage address corresponding to the dry contact function bit identifier in step 102 may include steps 121 to 123 .
[0041] Step 121: Determine the dry contact group to which the dry contact belongs based on a first partial value in the dry contact function bit identifier, wherein the first partial value is determined based on a plurality of bits at a first position.
[0042] In the embodiment of the present application, the dry contact function bit identifier can be represented by a first number of bits, and the first number can be 8, that is, the dry contact function bit identifier is represented by eight bits.
[0043] In an embodiment of the present application, the dry contact function bit identifier includes a first partial value, wherein the first partial value may be a portion of the dry contact function bit identifier used to indicate a dry contact group. The first partial value may be determined based on multiple bits in a first position, typically certain bits in the high-order bits of the dry contact function bit identifier. For example, the first partial value may be determined based on the first four bits of the dry contact function bit identifier. For example, in code 0x8003, the first partial value may use bits 8 to 11 to determine the dry contact group number.
[0044] In the embodiments of the present application, by parsing the first portion of the dry contact function bit identifier, it is possible to determine to which dry contact group the currently processed dry contact belongs. A dry contact group logically groups multiple dry contacts for easier management and access. For example, each dry contact group can contain 16 dry contacts, so a total of 16 dry contact groups can manage 256 dry contacts. This improves system scalability and management efficiency.
[0045] In this embodiment of the present application, by parsing the first portion of the dry contact function bit identifier to determine the dry contact group, a large number of dry contacts can be effectively categorized and organized, thereby improving the flexibility and configurability of the system and supporting the input / output control requirements of up to 256 dry contacts.
[0046] Step 122: Determine the dry contact bit position where the dry contact is located based on the second partial value in the dry contact function bit identifier, wherein the second partial value is determined based on multiple bits at the second position.
[0047] In an embodiment of the present application, the dry contact function bit identifier further includes a second partial value. The second partial value may be a portion of the dry contact function bit identifier used to indicate a specific bit position of the dry contact. The second partial value may be determined based on multiple bits in a second position, typically certain bits in the low-order bits of the dry contact function bit identifier. For example, the second partial value may be represented based on the last four bits of the dry contact function bit identifier. For example, in the code 0x8003, the second partial value may use bits 12 to 15 to determine the bit position of the dry contact within the group. By parsing this partial value, the specific position of the dry contact within the group to which it belongs can be located.
[0048] In an embodiment of the present application, there is a hierarchical relationship between the dry contact group and the dry contact bit, that is, the dry contact group is first determined based on the first part of the value, and the dry contact bit is determined by parsing the second part of the value in the dry contact function bit identifier, so that the specific position of the dry contact in the group can be accurately located, thereby realizing refined control of a single dry contact, and thus improving the accuracy and response speed of the system.
[0049] Step 123: Determine a storage address corresponding to the dry contact based on the dry contact group and the dry contact bit, and store the target level in the storage address.
[0050] In the embodiment of the present application, after determining the dry contact group and the dry contact bit, the specific storage address of the dry contact in the memory of the corresponding dry contact type can be calculated based on these two parameters. For example, each dry contact group occupies 2 bytes (16 bits), and the storage address can be calculated using the following formula (1): Storage address = dry contact group × size of each group + dry contact bit (1) In this way, once the storage address is determined, the target level (such as high level 1 or low level 0) can be written to the address to complete the level status update of the corresponding function of the dry contact. This method ensures that the level status of each dry contact corresponding function can be read and modified independently, improving the controllability and flexibility of the system.
[0051] In a feasible scenario, taking the dry contact as the input dry contact and the first level as the detection level of the input dry contact (InputDryin) as an example, continue to refer to Figure 2 and Figure 4 As shown. Example 1, the EPO protocol configuration code is 0x8003, where 03 is the dry contact function bit identifier, also known as the function type, and the high level is valid. The dry contact group u16TypeGroup where the input dry contact is located is 0, the dry contact bit value u16TypeBit is 3, and the input dry contact detection level InputDryIn[OU].bit1 in channel 2 corresponds to the EPO input dry contact hardware signal. Continue to refer to Figure 4 As shown, after the logic operation strategy corresponding to the input dry contact, the target level obtained will be moved to the bit 3 position of the 0th group of InputDryctrl corresponding to the input dry contact according to the dry contact group value and dry contact bit value of the input dry contact and the number of channels where the output dry contact is located (number of channels = 2). Example 2, the battery grounding abnormality protocol configuration code is 0x0006, where 06 is the dry contact function bit identifier, which is valid at low level. The dry contact group u16TypeGroup of the input dry contact is 0, and the dry contact bit value u16TypeBit is 6. InputDryIn[OU].bit2 in channel 3 corresponds to the battery grounding abnormality input dry contact hardware signal. Continue to refer to Figure 4 As shown in the figure, after the logic operation strategy corresponding to the input dry contact, according to the number of channels where the output dry contact is located (number of channels = 3), the target level of the input dry contact, such as the functional logic level, is moved to the bit 6 position of group 0 of the InputDryctrl corresponding to the input dry contact according to the dry contact group value and dry contact bit value of the input dry contact.
[0052] From the above, it can be seen that there is a clear mapping relationship between the dry contact group, dry contact bit and storage address in the embodiment of the present application. The dry contact group and bit are obtained by parsing the dry contact function bit identifier, and then the storage address is determined based on the dry contact group and bit and the target level is written to the address. In this way, the level status of the corresponding functions of a large number of dry contacts can be efficiently managed, thereby realizing flexible input / output control, and thus being able to meet the configurable requirements in different application scenarios.
[0053] In some embodiments, the dry contact function bit identifier is represented by a first number of bits, and the process of storing the target level to the storage address corresponding to the dry contact function bit identifier in step 102 may further include steps 124 and 125.
[0054] Step 124: Obtain a first mapping relationship, wherein the first mapping relationship includes a mapping relationship between dry contact function bit identifiers and corresponding storage addresses; Step 125: Search the first mapping relationship for a storage address corresponding to the dry contact function bit identifier.
[0055] In the embodiment of the present application, first, the configuration information of the dry contact function bit identifiers corresponding to each dry contact of different types is predetermined, and the storage space corresponding to each type of dry contact is determined. Then, a one-to-one mapping relationship is established between the dry contact function bit identifiers corresponding to each dry contact of the same type and a storage address in the storage space, thereby obtaining a first mapping relationship corresponding to the dry contacts of the same type. Finally, after obtaining the configuration information of each dry contact, the storage address corresponding to the dry contact function bit identifier in the configuration information is searched from the first mapping relationship, and the target level of the dry contact is stored in the storage address.
[0056] In a feasible scenario, taking the dry contact as the output dry contact and the first level as the functional logic level (OutputDryin) of the output dry contact as an example, continue to refer to Figure 3 and Figure 5 As shown in Example 1, the protocol configuration battery power code is 0x8003, where 03 is the dry contact function bit identifier, and the high level is valid. The dry contact group u16TypeGroup where the output dry contact is located is 0, the dry contact bit value u16TypeBit is 3, and the output dry contact logic function level OutputDryIn[0U].bit4 in channel 5 corresponds to the battery power output dry contact hardware signal. Continue to refer to Figure 5 As shown, after the logic operation strategy corresponding to the output dry contact, the storage address corresponding to the dry contact function bit identifier of the output dry contact is searched according to the first mapping relationship, such as the bit4 position of the 0th group of OutoutDryout. According to the number of channels where the output dry contact is located (the number of channels = 5), the target level of the output dry contact, such as the control level, is stored in the bit4 position of the 0th group of OutoutDryout. Example 2, the UPS abnormal protocol configuration code is 0x0006, where 06 is the dry contact function bit identifier, which is valid at low level. The dry contact group u16TypeGroup where the output dry contact is located is 0, and the dry contact bit value u16TypeBit is 6. OutoutDryIn[OU].bit7 in channel 8 corresponds to the UPS abnormal output dry contact hardware signal. Continue to refer to Figure 5As shown, after the logic operation strategy corresponding to the output dry contact is performed, the storage address corresponding to the dry contact function bit identifier of the output dry contact is searched according to the first mapping relationship, such as the bit 7 position of the 0th group of OutputDryout. According to the number of channels where the output dry contact is located (the number of channels = 3), the target level of the output dry contact, such as the control level, is moved to the bit 7 position of the 0th group of OutputDryout corresponding to the output dry contact.
[0057] From the above, we can see that, first, by directly locating the storage address through the predefined mapping relationship, the time overhead of the traditional traversal search method is avoided, and the response speed of the dry contact configuration is significantly improved. In particular, in a large-scale system processing 256 dry contacts, the address search efficiency can be improved to O(1) time complexity. Secondly, the mapping relationship can be dynamically adjusted according to actual needs and supports non-continuous allocation of storage addresses. This enables the system to use memory space more efficiently, such as centrally storing frequently used dry contacts in the cache area to optimize system performance. Then, when a new dry contact type needs to be added or a function needs to be expanded, only the mapping relationship table needs to be updated, without modifying the core configuration logic, which greatly reduces the complexity of system upgrades.
[0058] The present invention provides a dry contact configuration method that receives a configuration instruction containing a function bit identifier and a valid level identifier, performs logical operations based on the characteristics of the input / output dry contacts, and ultimately writes the target level to the corresponding storage address. This method enables dynamic configuration of dry contact functions and levels, improving the system's flexibility and adaptability to meet the diverse needs of different application scenarios.
[0059] Figure 6 This is an optional flow chart of the dry contact configuration method provided in the embodiment of the present application, wherein the dry contact configuration instruction is an input dry contact configuration instruction, the first level is the detection level, and the following will be combined with Figure 6 The steps shown are explained.
[0060] Step 601: Receive an input dry contact configuration instruction; wherein the input dry contact configuration instruction includes configuration information and detection level corresponding to at least one input dry contact, and the configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the input dry contact.
[0061] In the embodiment of the present application, the dry contact configuration instruction is an input dry contact configuration instruction, and the first level is a detection level of a function corresponding to the input dry contact.
[0062] In the embodiment of the present application, the detection level refers to the level state of the dry contact input signal actually detected by the hardware circuit, which reflects the current real state of the external device, such as whether a relay is closed, whether a button is pressed, etc.
[0063] Step 602: For each input dry contact, determine the input logic level of the input dry contact based on a first logic operation between the valid level identifier and the detection level.
[0064] In an embodiment of the present application, for each input dry contact, the input logic level of the input dry contact is determined based on a first logical operation between the effective level identifier of the input dry contact and the detection level. It should be noted that the input logic level is an intermediate result used for subsequent functional judgment. If the result of the operation is high, it indicates that the dry contact is in a valid state; if it is low, it indicates an invalid state. This intermediate variable provides a basis for subsequent functional judgment. In this way, dynamic judgment of the input dry contact can be achieved, thereby ensuring that the system can correctly respond to external input signals according to the user's configuration. In this way, erroneous actions caused by misjudgment can be avoided, and the stability and reliability of the system can be improved.
[0065] Step 603: Determine the functional logic level of the input dry contact based on the input logic level, wherein the target level includes the functional logic level.
[0066] In the embodiments of the present application, for each dry input contact, the input logic level of the dry input contact is determined based on a first logical operation between the valid level indicator and the detection level. Then, based on the input logic level, the functional logic level of the dry input contact is determined. Thus, by performing a logical operation between the detection level and the valid level indicator to obtain the input logic level, and further deriving the functional logic level, dynamic judgment of the functional status of the dry input contact is achieved. Compared to existing technologies, this method can more accurately identify the validity of the input signal and avoid functional errors caused by level misjudgment.
[0067] In some embodiments, step 603 determines the functional logic level of the input dry contact based on the input logic level, which can be implemented by step 631 or step 632 .
[0068] Step 631: Use the input logic level as the functional logic level of the input dry contact.
[0069] In an embodiment of the present application, the input logic level can be the high or low state of the dry contact input signal detected by hardware, which is usually used to indicate the state of an external device or sensor. When the input logic level is consistent with the configured effective level, the input logic level can be directly regarded as the functional logic level, that is, the functional logic level is equal to the input logic level, and no further processing is required. For example, in the EPO function, if the configuration is valid at a high level, when the input is detected to be a high level, it is directly determined that the dry contact has triggered an EPO event. In this way, the processing flow can be simplified, unnecessary computational overhead can be avoided, and the response speed of the system can be improved, thereby being able to meet application scenarios with high real-time requirements.
[0070] Step 632: Obtain a configuration result of the function bit corresponding to the dry contact function bit identifier; perform a logical operation on the configuration result and the input logic level according to the input logic level to obtain a function logic level.
[0071] In an embodiment of the present application, before configuring the function bits corresponding to the multiple input dry contacts, it is possible to pre-configure whether to enable some or all of the multiple function bits. Here, enabling some or all of the multiple function bits includes: for the enabled function bits, the configuration result can be the function bit corresponding to the pre-configured enable dry contact function bit flag. In this case, the configuration result of the function bit can be a high level, such as 1. Of course, for the unenabled function bits, the configuration result of the function bit can be a low level, such as 0.
[0072] In some embodiments, in step 632 , a logical operation is performed on the configuration result and the input logic level according to the input logic level to obtain a functional logic level, which may include steps 6321 and 6322 .
[0073] Step 6321: If the input logic level is the first value, perform a second logic operation on the configuration result and the input logic level to obtain a functional logic level.
[0074] In this embodiment of the present application, the second logical operation may refer to a logical processing method that uses an OR operation with the configuration level when the input logic level is high. Specifically, when the dry contact input is valid, the expression functional logic level = configuration result | (~ (configuration valid level ^ input detection level)) is used for calculation. This operation ensures that the corresponding functional position is set to 1 only when the input level is consistent with the configured valid level, thereby achieving precise control of the functional logic level.
[0075] In this way, through the setting of the second logical operation, the system can accurately determine whether the input signal meets the preset conditions, and update the state of the functional logic level accordingly, thereby improving the response accuracy and stability of the system.
[0076] Step 6322: If the input logic level is the second value, perform a third logic operation on the configuration result and the input logic level to obtain a functional logic level.
[0077] The first logic operation, the second logic operation and the third logic operation are all different.
[0078] In this embodiment of the present application, the third logic operation refers to a logical processing method that performs an AND operation with the configured level when the input logic level is low. Specifically, when the dry contact input is invalid, the expression "Function logic level = Configuration result & (~ (Configuration valid level ^ Input detection level)" is used for calculation. This operation ensures that the corresponding function bit is not activated unless the input level is inconsistent with the configured valid level, thereby preventing false triggering.
[0079] In this way, by setting the third logical operation, the system can maintain its original state when the input signal does not meet the preset conditions, prevent unnecessary function bits from being activated, and enhance the stability and reliability of the system.
[0080] It should be noted that the first, second, and third logical operations are different. These three logical operations are applicable to different input states, ensuring that the system can flexibly adjust the output of the functional logic level according to changes in the input signal to meet the needs of different scenarios.
[0081] In the embodiment of the present application, by setting three different logical operation modes, the functional logic level can be dynamically adjusted according to the different states of the input signal, so that the behavior of the dry contact can be accurately controlled, thereby improving the flexibility and adaptability of the system and meeting the diverse project configuration requirements.
[0082] Figure 7 This is an optional flow chart of the dry contact configuration method provided in the embodiment of the present application, wherein the dry contact configuration instruction is an output dry contact configuration instruction, the first level is a functional logic level, and the following will be combined with Figure 7 The steps shown are explained.
[0083] Step 701: Receive an output dry contact configuration instruction; wherein the output dry contact configuration instruction includes configuration information and functional logic levels corresponding to at least one output dry contact, and the configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the output dry contact.
[0084] Step 702: For each output dry contact, obtain a configuration result of a function bit corresponding to the dry contact function bit identifier.
[0085] In an embodiment of the present application, before configuring the function bits corresponding to the plurality of output dry contacts, it is possible to pre-configure whether to enable some or all of the plurality of function bits. Here, enabling some or all of the plurality of function bits includes: for an enabled function bit, the configuration result may be a pre-configured function bit corresponding to the enable dry contact function bit identifier. In this case, the configuration result of the function bit may be a high level, such as 1. Of course, for a non-enabled function bit, the configuration result of the function bit may be a low level, such as 0.
[0086] Step 703: Perform a third logic operation on the configuration result and the functional logic level to obtain the output logic level of the output dry contact.
[0087] In the embodiment of the present application, the third logical operation may be an AND logical operation.
[0088] In the embodiment of the present application, after obtaining the output dry contact configuration instruction, an AND operation is performed based on the valid level identifier in the configuration information of each output dry contact and the configuration result to obtain the output logic level. This operation method can ensure that when the configuration result is inconsistent with the functional logic level, the output logic level is low (0), and when consistent, it is high (1). This design can achieve flexible adjustment of the output control signal, so that it automatically switches between high and low level states according to the configuration requirements.
[0089] In practical applications, for example, if an output dry contact is configured as a UPS abnormal function and is set to be active at low level, if the function logic level is high (1) and the configuration result is high (1), the output logic level will be high (1); conversely, if the function logic level is low (0) and the configuration result is high (1), the output logic level will be low (0).
[0090] Step 704: Perform a first logic operation on the valid level identifier and the output logic level to obtain a control level of the output dry contact; wherein the target level includes the control level.
[0091] In the embodiments of the present application, the control level may be the electrical signal that ultimately determines the behavior of the output dry contact. The control level determines whether the external device is activated, such as whether a relay is closed or an indicator light is illuminated. The target level is a broader concept that encompasses all possible levels used for control, and the control level is a specific manifestation of this.
[0092] In the embodiment of the present application, for each output dry contact, a control level of the output dry contact is obtained based on a first logical operation between the valid level identifier and the output logic level.
[0093] As can be seen from the foregoing, in the embodiments of the present application, the output logic level of the output dry contact is generated by a logical operation based on the configuration result and the functional logic level, and the control level of the output dry contact is generated by a logical operation based on the output logic level and the valid level indicator. This allows for dynamic control of the output dry contact, thereby adapting to the configuration requirements of various application scenarios and significantly improving the compatibility and maintainability of the system.
[0094] The following describes an implementation process of the embodiment of the present application in a feasible application scenario.
[0095] To meet the requirements of different projects for the number of input / output dry contacts, this embodiment of the application provides a configurable number of input / output dry contacts, with a maximum of 256 dry contacts. The function and effective level of each dry contact can be configured via the touch screen. The following describes the solution of this application.
[0096] According to the functional requirements, the function configuration can be carried out for different types of dry contacts. For input dry contacts, such as Figure 8 As shown, the configuration information 801 of the input dry contact and the detection level 802 of the input dry contact can be subjected to logic processing 803 corresponding to the input dry contact to obtain the functional logic level 804 of the input dry contact. Figure 9 As shown, the configuration information 805 of the output dry contact and the functional logic level 806 of the output dry contact may be subjected to logic processing 807 corresponding to the output dry contact to obtain a control level 808 of the output dry contact.
[0097] In this embodiment, the touch screen transmits configuration information for different types of dry contacts. This information is formatted as Uint16 data, where the lower eight bits represent the function type of the dry contact and the uppermost bit represents the active level. The function type of the dry contact is fixedly coded, for example, EPO is coded 03 and bypass is coded 06. A high active level is coded 1, and a low active level is coded 0.
[0098] For input dry contacts, refer to Figure 8 and Figure 10 As shown, configuration information for an input dry contact is obtained 801. Based on the configuration information, the function type corresponding to the input dry contact and the input valid level of the input dry contact are obtained 902 and 903. Based on the function type corresponding to the input dry contact, a determination is made as to whether the function flag bit corresponding to the function type is configured 904 (corresponding to the configuration result described above). It should be noted that if configured, the function flag bit is set to 1; if not, the function flag bit is set to 0. Furthermore, the detected input dry contact level 802 is XORed and then inverted 906 to obtain the input logic level of the input dry contact 907. Furthermore, a determination is made as to whether the input logic level is high 908. If so, the function flag bit is ORed with the input logic level 909 to obtain the function logic level 804, i.e., the function logic level of the function corresponding to the input dry contact is set to 1. If not, the function flag bit is ANDed with the input logic level 911 to obtain the function logic level 804, i.e., the function logic level of the function corresponding to the input dry contact is set to 0.
[0099] Among them, when the detection level input of the input dry contact is valid, the functional logic level of the function corresponding to the input dry contact can be expressed by the following expression (1).
[0100] Function logic level = configuration function flag bit | (~ (configuration valid level ^ detection level)) (1) Among them, when the detection level input of the input dry contact is invalid, the functional logic level of the function corresponding to the input dry contact can be expressed by the following expression (2).
[0101] Function logic level = configuration function flag & (~ (configuration valid level ^ input detection level)) (2) For output dry contacts, refer to Figure 9 and Figure 11 As shown, the configuration information 805 of the output dry contact is obtained. Based on the configuration information, the function type 1002 and the output valid level 1003 corresponding to the output dry contact are obtained. Based on the function type corresponding to the output dry contact, it is determined whether the function flag bit 1004 corresponding to the function type is configured (corresponding to the above-mentioned configuration result). It should be noted that if configured, the function flag bit is 1, and if not configured, the function flag bit is 0. Furthermore, the obtained function logic level 806 of the output dry contact is ANDed with the function flag bit 1004 to obtain the output logic level 1007 of the output dry contact. The output logic level is then XORed with the output valid level 1003 and then inverted 1008 to obtain the control level 808 of the output dry contact. The control level of the output dry contact can be expressed by the following expression (3).
[0102] Output control level = ~ (configuration output valid level ^ (function logic level & corresponding function flag bit)) (3) At the same time, in order to make the configuration information of the input dry contact sent from any position of the touch screen, the screen input dry contact setting interface channel 2 is configured with EPO, which is valid at high level; the interface channel 3 is configured with battery grounding abnormality, which is valid at low level, such as Figure 2 shown.
[0103] The EPO protocol configuration code is 0x8003. 03 represents the dry contact function type, which is active high. Its type group value, u16TypeGroup, is 0, and its type bit value, u16TypeBit, is 3. InputDryIn[OU].bit1 in channel 2 corresponds to the EPO input dry contact hardware signal. During the input dry contact logic determination process, the determination result is transferred to bit 3 of the input dry contact function logic level, InputDryctrl, based on the type group and type bit values.
[0104] The battery grounding anomaly protocol configuration code is 0x0006. 06 represents the dry contact function type, which is active low. Its type group value, u16TypeGroup, is 0, and its type bit value, u16TypeBit, is 6. InputDryIn[OU].bit2 in channel 3 corresponds to the battery grounding anomaly input dry contact hardware signal. During the input dry contact logic judgment process, the judgment result is transferred to bit 6 of the InputDryctrl function logic level in the dry contact input according to the type group value and type bit value.
[0105] Similarly, refer to Figure 3 As shown, the screen output dry contact setting interface channel 5 is configured for battery power supply, and the high level is valid; the interface channel 8 is set to UPS abnormality, and the low level is valid.
[0106] The protocol configuration battery power supply code is 0x8003. The output dry contact control level result is stored in the bit 4 position of group 0 of OutoutDryout according to the channel number where the dry contact is located (channel number = 5). Channel 8 is configured with UPS abnormality. The output dry contact control level result is stored in the bit 7 position of group 0 of OutoutDryout according to the channel number where the dry contact is located (channel number = 8).
[0107] Using this solution in a project can be achieved in the following ways: The first step is to use the program. You need to add Aux_Dry_Func_V1_02.c and Aux_Dry_Func_V1_02.h to the project, and add Aux_Dry_Func_V1_02.h to the includes.h file. In the application file, declare the structure corresponding to the data structure. Call the algorithm in the corresponding application function.
[0108] The second step is to call the project method. Find the following macro definition in Aux_Dry_Func_V1_02.h and modify it according to the actual situation.
[0109] #define DRYIN_NUM10U / *!<1≤Number of dry contacts input≤256, [0x00, 0xFF], including 0x00 prohibited>* / #define DRYOUT_NUM10U / *!<1≤Number of output dry contacts≤256, [0x00, 0xFF], including 0x00 prohibited>* / The third step is input and output variables. To ensure the normal operation of the input / output dry contact function, some variables need to be assigned in real time. Some input dry contact-related variables in the function are uniformly placed in the structure ST_INPUT_DRY_REG, and some output dry contact-related variables in the function are uniformly placed in the structure ST_OUTPUT_DRY_REG. The following are the input and output parameters of this function, among which Table 1 is the input dry contact input parameters, Table 2 is the input dry contact output parameters, Table 3 is the output dry contact input parameters, and Table 4 is the output dry contact output parameters.
[0110] Table 1
[0111] Table 2
[0112] Table 3
[0113] Table 4
[0114] Step 4: Call the function example.
[0115] The initialization function is placed in the corresponding initialization position; Set the number of input dry contacts DRYIN_NUM (1≤input dry contacts≤256, [0x00, 0xFF], including 0x00 for prohibition) and the number of output dry contacts DRYOUT_NUM (1≤input dry contacts≤256, [0x00, 0xFF], including 0x00 for prohibition); The corresponding input and output dry contact types and effective levels are defined in the structures u16InPutCtrlRegs and u16OutPutCtrlRegs. The configuration information is Uint6 data, where the lower eight bits are the dry contact type and the highest bit is the effective level. For example, if the input dry contact channel 2 is configured with EPO, the configuration code is 0x8003; if the output dry contact channel 8 is configured with UPS abnormality, the configuration code is 0x0006. Figure 12 shown.
[0116] Assign a value to bit 1 of InputDryIn [DRYIN_GROUP_NUM], the detection level of input dry contact channel 2 (EPO).
[0117] g_stAuxFuncReg.InputDry.InputDryIn[0U].bits.bBit1Flg=DRY_IN_8IN1_9TO16(); Assign a value to bit 7 of the function logic level OutputDryIn[DRYOUT_GROUP_NUM] of output dry contact channel 8.
[0118] p->OutputDry. OutputDryIn[0U].bits.bBit7Flg = RlyCtrlRegs.CtrlFlagCabOut.bits.bUPSError; The output of the dry contact input is the functional logic level InputDryCtrl. When the detection level of dry contact input channel 2 (EPO) is high and consistent with the effective level configured for channel 2 (EPO) on the screen, the output functional logic level InputDryCtrl[0].bit3 of the dry contact input is 1. When the detection level of dry contact input channel 2 (EPO) is low and inconsistent with the effective level configured for channel 2 (EPO) on the screen, the output functional logic level InputDryCtrl[0].bit3 of the dry contact input is 0.
[0119] The output of the dry contact output is the output dry contact control level OutputDryOut. When the function logic level of output dry contact channel 8 (UPS abnormality) is high and inconsistent with the effective level configured for channel 8 (UPS abnormality) on the screen, the output dry contact control level OutputDryOut[0].bit7 = 0. When the function logic level of output dry contact channel 8 (UPS abnormality) is low and consistent with the effective level configured for channel 8 (UPS abnormality) on the screen, the output dry contact control level OutputDryOut[0].bit7 = 1.
[0120] It should be noted that this dry contact function supports the configuration of up to 256 input / output dry contact signals. If expansion is required, corresponding changes must be made. Input and output dry contact settings must be configured. Dry contact configuration information is Uint16 data, where the lower eight bits represent the dry contact type and the highest bit represents the active level. InputDryIn[DRYIN_GROUP_NUM].all must be assigned a value representing the input dry contact detection level. OutputDryIn[DRYOUT_GROUP_NUM].all must be assigned a value representing the functional logic level of the output dry contact. This implementation allows for flexible configuration and efficient processing of input / output dry contacts.
[0121] This upgrade to the dry contact configuration application allows for configuration of a larger number of dry contacts, up to a maximum of 256. The original code used a single word to represent eight input / output dry contacts, but this was expanded to an unsigned 16-bit array. This maintains compatibility with the original dry contact logic while allowing for flexible configuration of input / output dry contacts. This solution has already been implemented in a subway bidirectional converter project and can be expanded to other products requiring dry contact configuration.
[0122] The present application embodiment provides a dry contact configuration device, referring to Figure 13 As shown, Figure 13 This is a schematic structural diagram of a dry contact configuration device provided in an embodiment of the present application. The dry contact configuration device 12 includes: The receiving module 1201 is configured to receive a dry contact configuration instruction, wherein the dry contact configuration instruction includes configuration information and a first level corresponding to at least one dry contact, and the configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the dry contact; The processing module 1202 is configured to perform a first logic operation on each dry contact based on the valid level identifier and the first level to determine a target level of the dry contact, and store the target level in a storage address corresponding to the dry contact function bit identifier.
[0123] An embodiment of the present application provides a power supply device, the power supply device comprising: at least one processor; and, A memory communicatively connected to at least one processor; wherein the memory stores a computer program executable by at least one processor, and the computer program is executed by at least one processor to implement some or all of the steps in the above method.
[0124] The present application provides a computer-readable storage medium storing one or more computer programs, which can be executed by one or more processors to implement some or all of the steps in the above method. The storage medium can be transient or non-transient.
[0125] An embodiment of the present application provides a computer program, including computer-readable code. When the computer-readable code runs in a power supply device, a processor in the power supply device executes some or all of the steps for implementing the above method.
[0126] An embodiment of the present application provides a computer program product, comprising a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, the computer program implements some or all of the steps of the above-described method. The computer program product can be implemented in hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium. In other embodiments, the computer program product is embodied as a software product, such as a software development kit (SDK).
[0127] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between the various embodiments, and their similarities or similarities can be referenced to each other. The descriptions of the above device, storage medium, computer program, and computer program product embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the description of the method embodiments of this application for understanding.
[0128] The embodiment of the present application provides a hardware entity diagram of a power supply device, which can be a vehicle or a terminal, such as Figure 14 As shown, the hardware entity of the power supply device 13 includes: at least one processor 1301; and, A memory 1302 in communication with at least one processor 1301; wherein the memory 1302 stores a computer program executable by the at least one processor 1301, and the computer program is executed by the at least one processor to implement the following steps: Receive a dry contact configuration instruction; wherein the dry contact configuration instruction includes configuration information and a first level corresponding to at least one dry contact, and the configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the dry contact; For each dry contact, a first logic operation is performed based on the valid level identifier and the first level to determine a target level of the dry contact, and the target level is stored in a storage address corresponding to the dry contact function bit identifier.
[0129] A processor 1301 and a memory 1302 , wherein the memory 1302 stores a computer program that can be run on the processor 1301 , and the processor 1301 executes part or all of the steps in the above-mentioned dry contact configuration method.
[0130] Among them, the memory 1302 stores a computer program that can be run on the processor. The memory 1302 is configured to store instructions and applications executable by the processor 1301. It can also cache data to be processed or processed by the processor 1301 and each module in the power supply device 13 (for example, image data, audio data, voice communication data and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0131] The processor 1301 generally controls the overall operation of the power supply device 13 .
[0132] The power supply device 13 may further include a communication bus and a communication interface.
[0133] The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory and at least one processor.
[0134] The communication interface is used for communication between the above-mentioned power supply device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the power supply device and other power supply devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the power supply device and to display a visual user interface.
[0135] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0136] The processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that the electronic device that implements the functions of the processor may also be other electronic devices, which are not specifically limited in the embodiments of the present application.
[0137] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface storage device, an optical disc, or a compact disc read-only memory (CD-ROM); it can also be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0138] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0139] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0140] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0141] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple convolutional network units; some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.
[0142] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0143] Those skilled in the art will understand that all or part of the steps of the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0144] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling an on-board terminal (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0145] The above is only an implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A dry contact configuration method, characterized in that: The method comprises: Receive a dry contact configuration instruction; wherein the dry contact configuration instruction includes configuration information and a first level corresponding to at least one dry contact, and the configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the dry contact; For each dry contact, a first logic operation is performed based on the valid level identifier and the first level to determine a target level of the dry contact, and the target level is stored in a storage address corresponding to the dry contact function bit identifier.
2. The method according to claim 1, characterized in that The dry contact configuration instruction is an input dry contact configuration instruction, the first level is a detection level, and performing a first logical operation on each dry contact based on the valid level identifier and the first level to determine a target level of the dry contact includes: For each input dry contact, performing a first logic operation on the valid level identifier and the detection level to obtain an input logic level of the input dry contact; Based on the input logic level, a functional logic level of the input dry contact is determined, wherein the target level includes the functional logic level.
3. The method according to claim 2, characterized in that The determining the functional logic level of the input dry contact based on the input logic level includes: Using the input logic level as the functional logic level of the input dry contact; or, Obtaining a configuration result of a function bit corresponding to the dry contact function bit identifier; According to the input logic level, a logical operation is performed on the configuration result and the input logic level to obtain the functional logic level.
4. The method according to claim 3, characterized in that The performing a logical operation on the configuration result and the input logic level according to the input logic level to obtain the functional logic level includes: If the input logic level is the first value, performing a second logic operation on the configuration result and the input logic level to obtain the functional logic level; If the input logic level is the second value, performing a third logic operation on the configuration result and the input logic level to obtain the functional logic level; The first logic operation, the second logic operation and the third logic operation are all different.
5. The method according to claim 1, characterized in that The dry contact configuration instruction is an output dry contact configuration instruction, the first level is a functional logic level, and performing a first logic operation on each dry contact based on the valid level identifier and the first level to determine a target level of the dry contact includes: For each output dry contact, obtaining a configuration result of a function bit corresponding to the dry contact function bit identifier; performing a third logic operation on the configuration result and the functional logic level to obtain an output logic level of the output dry contact; A first logic operation is performed on the effective level identifier and the output logic level to obtain a control level of the output dry contact; wherein the target level includes the control level.
6. The method according to any one of claims 1 to 5, characterized in that The first logical operation is an exclusive-or and inverted operation.
7. The method according to any one of claims 1 to 5, characterized in that The dry contact function bit identifier is represented by a first number of bits, and storing the target level in a storage address corresponding to the dry contact function bit identifier includes: Determine, based on a first partial value in the dry contact function bit identifier, a dry contact group in which the dry contact is located, wherein the first partial value is determined based on a plurality of bits at a first position; determine, based on a second partial value in the dry contact function bit identifier, a dry contact bit position in which the dry contact is located, wherein the second partial value is determined based on a plurality of bits at a second position; determine, based on the dry contact group and the dry contact bit position, a storage address corresponding to the dry contact, and store the target level at the storage address; or, A first mapping relationship is obtained, wherein the first mapping relationship includes a mapping relationship between a dry contact function bit identifier and a corresponding storage address; and the storage address corresponding to the dry contact function bit identifier is searched from the first mapping relationship.
8. The method according to any one of claims 1 to 5, characterized in that The dry contact configuration instruction is generated based on a user's touch operation on a dry contact configuration interface, and the dry contact configuration interface includes parameters corresponding to function bits and effective level identifiers of dry contact function bit identifiers of multiple dry contacts.
9. A dry contact configuration device, characterized in that: The device comprises: A receiving module, configured to receive a dry contact configuration instruction; wherein the dry contact configuration instruction includes configuration information and a first level corresponding to at least one dry contact, and the configuration information includes at least a dry contact function bit identifier and a valid level identifier corresponding to the dry contact; The processing module is configured to perform a first logic operation on each dry contact based on the valid level identifier and the first level to determine a target level of the dry contact, and store the target level in a storage address corresponding to the dry contact function bit identifier.
10. A power supply device, characterized in that: The power supply device comprises: at least one processor; and, A memory communicatively connected to at least one processor; wherein the memory stores a computer program executable by at least one processor, and the computer program is executed by at least one processor to implement the dry contact configuration method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Electrommunication information power environment monitoring dry contact collecting device
CN101776874A
Dry contact conversion module and control system and method therefor
CN105116778A
Dry-contact controller and control method, devices and storage medium
CN109525430A
Dry contact conversion module and control system thereof
CN204904004U
Dry contact alarm unit for fan
KR101545643B1