System and method for quickly adapting to service change

By generating a decoupled mapping table between the application end and the electrical control end, the problem of needing to modify the source code for changes in equipment functions is solved, enabling fast, flexible, and secure business adaptation, and improving development efficiency and system stability.

CN121979566APending Publication Date: 2026-05-05SICHUAN CHANGHONG AIR CONDITIONER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SICHUAN CHANGHONG AIR CONDITIONER CO LTD
Filing Date
2026-01-29
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing technologies require modifications to the source code when changing device functions, resulting in long development cycles, high costs, high stability risks, and poor flexibility, making it impossible to quickly and flexibly adapt to third-party business needs.

Method used

By parsing configuration files to generate structure templates, the application end and the electrical control end are decoupled. A mapping relationship table is generated using Python parsing scripts and predefined structure templates. Without modifying the core source code of the equipment, business function changes can be adapted simply by updating the configuration files.

Benefits of technology

Significantly shortens development and testing cycles, reduces system risks, improves flexibility and efficiency, and allows non-developers to respond quickly to business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121979566A_ABST
    Figure CN121979566A_ABST
Patent Text Reader

Abstract

The invention mainly relates to the technical field of program testing, and provides a system and a method for quickly adapting to business change in order to enable electric control equipment to quickly adapt to business function change, an analysis unit analyzes a configuration file, and generates a first structural body and a second structural body based on a predefined structural body template; the first structural body is used for storing a mapping relation from an application end function identifier to an electric control parameter, the second structural body is used for storing a mapping relation from an electric control end attribute identifier to an application end report parameter, and the application end command interpretation unit analyzes a control command sent by an application end into the electric control parameter based on the first structural body. The electric control command packaging unit assembles electric control parameters into an electric control command and issues the electric control command to the electric control end, and the electric control state interpretation unit analyzes state information returned after the electric control end executes the control command into state report data which can be identified by the application end based on a second structural body; and the sending module is used for sending the state report data to the application end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention mainly relates to the field of program testing technology, and in particular to a system and method for rapidly adapting to business changes. Background Technology

[0002] With the rapid development of IoT and smart terminal technologies, smart home appliances, smart hardware, and other smart devices are becoming increasingly feature-rich. Their systems typically consist of multiple components, including the device itself, the application itself, and the underlying electronic control module. To enhance user experience and market competitiveness, device manufacturers frequently need to respond to third-party business demands, such as adding new control functions to the application, adjusting interaction logic, or adapting to new electronic control protocols.

[0003] like Figure 1 As shown, in the traditional development model, such functional changes typically require in-depth modifications to the core business logic source code on the device side. The process generally includes: requirements analysis, source code-level development, compilation and building, comprehensive testing, and bug fixing. This model has the following significant drawbacks: Long development cycle and high cost: Each feature change requires adaptation and modification of the entire system code framework, requiring the involvement of professional developers to write, debug and verify the code according to the process, which leads to a longer project cycle and increased labor costs.

[0004] High stability risk: Directly modifying the core source code will introduce unpredictable risks, which may affect the stability of the original functions, thus requiring more extensive regression testing and further extending the testing cycle.

[0005] Poor flexibility and strong dependency: The business logic is highly coupled with the implementation code, making the creation, deletion, modification and query functions heavily dependent on the development team. It cannot be quickly configured by product or implementation personnel and is difficult to cope with agile and ever-changing third-party business requirements.

[0006] In existing technologies, there are also some solutions that externalize some logic through configuration files or scripts, but these solutions are often only for a single link or a specific format, and cannot efficiently perform complex command mapping, state transitions, and bidirectional communication protocol adaptation.

[0007] Therefore, there is an urgent need in this field for a system and method that can quickly, flexibly and securely adapt to changes in third-party business functions without modifying the main source code of the device, so as to resolve the contradiction between development efficiency, system stability and business flexibility. Summary of the Invention

[0008] The technical problem to be solved by this invention is to provide a system and method for quickly adapting to business changes, with the aim of enabling electrical control equipment to quickly adapt to changes in business functions without modifying the source code.

[0009] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows: On one hand, the present invention provides a system for rapidly adapting to business changes, the system comprising: The parsing unit is used to parse the configuration file and generate a first structure and a second structure based on a predefined structure template. The configuration file is used to define new or changed business functions and includes application-side function identifiers, electrical control-side attribute identifiers, and communication parameters. The first structure is used to store the mapping relationship from application-side function identifiers to electrical control parameters. The second structure is used to store the mapping relationship from electrical control-side attribute identifiers to application-side reported parameters. The application-side command interpretation unit parses the control commands issued by the application side into electronic control parameters based on the first structure. The electronic control command encapsulation unit is used to assemble electronic control parameters into electronic control commands and send them to the electronic control terminal. The electronic control status interpretation unit, based on the second structure, parses the status information returned by the electronic control terminal after executing the control command into status reporting data that can be recognized by the application terminal. The electronic control status reporting unit is used to send status reporting data to the application terminal.

[0010] Furthermore, the predefined structure template includes a function name field for storing application-side function identifiers, an attribute number field for storing electrical control-side attribute identifiers, a field for storing communication parameter data length, and a field for storing communication parameter values.

[0011] Furthermore, the predefined structure template also includes an operation permission field, which is used to identify the read and write permissions of the corresponding function; the application-side command interpretation unit and the electronic control status interpretation unit determine whether to execute the parsing task by verifying the operation permission field.

[0012] Furthermore, the parsing unit is a Python parsing script, and the configuration file is a formatted text file read based on the Python parsing script.

[0013] On the other hand, the present invention provides a method for quickly adapting to business changes, the method comprising: Step S1: Define the configuration file according to the newly added or changed business functions. The configuration file includes application-side function identifiers, electrical control-side attribute identifiers, and communication parameters. Step S2: Parse the configuration file based on the predefined structure template to generate a first structure and a second structure; wherein, the first structure is used to store the mapping relationship from the application-side function identifier to the electronic control parameters, and the second structure is used to store the mapping relationship from the electronic control attribute identifier to the application-side reported parameters. Step S3: Receive control commands from the application and parse the control commands into electronic control parameters by querying the first structure; Step S4: Assemble the electronic control parameters into electronic control commands and send them to the electronic control terminal; Step S5: Receive the status information returned by the electronic control terminal after executing the control command, and parse the status information into status reporting data that the application terminal can recognize by querying the second structure; Step S6: Send the status reporting data to the application.

[0014] Furthermore, when querying the first structure, the application-side function identifier in the control command is used as the index; when querying the second structure, the electronic control terminal attribute identifier in the status information is used as the index.

[0015] The beneficial effects of this invention are as follows: By parsing the configuration file defining new or changed services, this invention generates a first structure based on a predefined structure template that stores the mapping relationship from application-side function identifiers to electronic control parameters, and a second structure that stores the mapping relationship from electronic control attribute identifiers to application-side reported parameters. This decouples application-layer business functions from the underlying electronic control protocol, so that when adding or changing business functions, only the configuration file needs to be modified and the system restarted, without modifying or compiling the core source code of the device. This significantly shortens the development and testing cycle, reduces the system risk caused by code changes, and allows non-developers to quickly respond to business needs through configuration. It significantly improves the flexibility, efficiency, and reliability of the electronic control system when dealing with frequent third-party business changes. Attached Figure Description

[0016] Figure 1 Flowcharts for adding or modifying business functions in existing technologies; Figure 2 This is a flowchart of a method for quickly adapting to business changes as described in this invention. Detailed Implementation

[0017] The core of the technical solution adopted by this invention to solve the above-mentioned technical problems is as follows: During system initialization, the parsing unit automatically generates a first structure and a second structure based on a predefined structure template, which serve as lookup tables for the mapping relationship between downlink control commands and uplink status feedback, respectively. When the application sends a control command, the system queries the first structure to parse it into electronic control parameters and sends it as a packet. When receiving electronic control status, the system queries the second structure to parse the electronic control attribute parameters of the electronic control terminal into a data format that the application can recognize and reports it. The entire process does not require modification or compilation of the core source code of the device, and can quickly adapt to changes in business functions simply by updating the configuration file.

[0018] Specifically, the system for rapidly adapting to business changes according to the present invention includes a parsing unit, an application-side command interpretation unit, an electrical control command encapsulation unit, an electrical control status interpretation unit, and an electrical control status reporting unit. The workflow of each of the above units is as follows: Figure 2 As shown, it specifically includes: Step S1: Define a configuration file based on the newly added or changed business functions. The configuration file shall include at least the application-side function identifier, the electrical control-side attribute identifier, and the communication parameters. The configuration file shall be set to a fixed-format text.

[0019] Step S2: The parsing unit parses the configuration file based on a Python parsing script; specifically including: A predefined structure template is used to parse the configuration file, generating a first structure and a second structure. The predefined structure template includes at least a function name field for storing application-side function identifiers, an attribute number field for storing electrical control terminal attribute identifiers, a field for storing communication parameter data lengths, and a field for storing communication parameter values. The first structure stores the mapping relationship from application-side function identifiers to electrical control parameters; when querying the first structure, the application-side function identifier in the control command is used as the index. The second structure stores the mapping relationship from electrical control terminal attribute identifiers to application-side reported parameters; when querying the second structure, the electrical control terminal attribute identifier in the status information is used as the index.

[0020] As a preferred option, the structure template also includes a command index field and an operation permission field. The operation permission field is used to identify the read and write permissions of the corresponding function. The application-side command interpretation unit and the electronic control status interpretation unit determine whether to execute the parsing task by verifying the operation permission field.

[0021] The predefined structure template in this embodiment is as follows: char name[MAX_NAME_LENGTH]; uint8_t first; uint8_t second; uint8_t length; uint8_t index; uint8_t right , / / bit0:read bit1:write; uint8_texist; uint32_t value; The name field is the function name field for storing application-side function identifiers. The first and second fields are the first-level and second-level power control attribute fields, respectively, used for hierarchical storage of power control attribute identifiers. The length field is the command length field. The index field is the command index field. The right field is the read / write permission field. The exist field is the field indicating whether commands are supported. The value field is the command value field.

[0022] In this embodiment, the first structure specifically includes a function name field, a command support field, a command index field, a read / write permission field, and a command value field.

[0023] In this embodiment, the second structure specifically includes a function name field, first-level and second-level electronic control attribute fields, a command length field, a command index field, and a command value field.

[0024] Step S3: Receive control commands from the application and parse the control commands into electronic control parameters by querying the first structure; Step S4: Assemble the electronic control parameters into electronic control commands and send them to the electronic control terminal; Step S5: Receive the status information returned by the electronic control terminal after executing the control command, and parse the status information into status reporting data that the application terminal can recognize by querying the second structure; Step S6: Send the status reporting data to the application.

Claims

1. A system for rapidly adapting to business changes, characterized in that, The system includes: The parsing unit is used to parse the configuration file and generate a first structure and a second structure based on a predefined structure template. The configuration file is used to define new or changed business functions and includes application-side function identifiers, electrical control-side attribute identifiers, and communication parameters. The first structure is used to store the mapping relationship from application-side function identifiers to electrical control parameters. The second structure is used to store the mapping relationship from electrical control-side attribute identifiers to application-side reported parameters. The application-side command interpretation unit parses the control commands issued by the application side into electronic control parameters based on the first structure. The electronic control command encapsulation unit is used to assemble electronic control parameters into electronic control commands and send them to the electronic control terminal. The electronic control status interpretation unit, based on the second structure, parses the status information returned by the electronic control terminal after executing the control command into status reporting data that can be recognized by the application terminal. The electronic control status reporting unit is used to send status reporting data to the application terminal.

2. The system for rapidly adapting to business changes according to claim 1, characterized in that, The predefined structure template includes a function name field for storing application-side function identifiers, an attribute number field for storing electrical control-side attribute identifiers, a field for storing communication parameter data lengths, and a field for storing communication parameter values.

3. The system for rapidly adapting to business changes according to claim 2, characterized in that, The predefined structure template also includes an operation permission field, which is used to identify the read and write permissions of the corresponding function; the application-side command interpretation unit and the electronic control status interpretation unit determine whether to execute the parsing task by verifying the operation permission field.

4. A system for rapidly adapting to business changes according to any one of claims 1-3, characterized in that, The parsing unit is a Python parsing script, and the configuration file is a formatted text file read based on the Python parsing script.

5. A method for rapidly adapting to business changes, applied to a system for rapidly adapting to business changes as described in any one of claims 1-4, characterized in that, The method includes: Step S1: Define the configuration file according to the newly added or changed business functions. The configuration file includes application-side function identifiers, electrical control-side attribute identifiers, and communication parameters. Step S2: Parse the configuration file based on the predefined structure template to generate a first structure and a second structure; wherein, the first structure is used to store the mapping relationship from the application-side function identifier to the electronic control parameters, and the second structure is used to store the mapping relationship from the electronic control attribute identifier to the application-side reported parameters. Step S3: Receive control commands from the application and parse the control commands into electronic control parameters by querying the first structure; Step S4: Assemble the electronic control parameters into electronic control commands and send them to the electronic control terminal; Step S5: Receive the status information returned by the electronic control terminal after executing the control command, and parse the status information into status reporting data that the application terminal can recognize by querying the second structure; Step S6: Send the status reporting data to the application.

6. The method for rapidly adapting to business changes according to claim 5, characterized in that, When querying the first structure, the application-side function identifier in the control command is used as the index; when querying the second structure, the electronic control terminal attribute identifier in the status information is used as the index.