CN-121979566-A - System and method for quickly adapting to service change
Abstract
The invention mainly relates to the technical field of program testing, and in order to enable an electric control device to quickly adapt to service function changes, the invention provides a system and a method for quickly adapting to service changes, an analysis unit analyzes a configuration file and generates a first structure body and a second structure body based on a predefined structure body template; the first structure is used for storing a mapping relation from an application end function identifier to an electric control parameter, the second structure is used for storing a mapping relation from an electric control end attribute identifier to an application end reporting parameter, the application end command interpretation unit is used for resolving a control command sent by the application end into the electric control parameter based on the first structure, the electric control command encapsulation unit is used for assembling the electric control parameter into an electric control command and sending the electric control command to the electric control end, the electric control state interpretation unit is used for resolving state information returned by the electric control end after the electric control end executes the control command into state reporting data which can be identified by the application end based on the second structure, and the electric control state reporting unit is used for sending the state reporting data to the application end.
Inventors
- DENG LINMING
- LUO TAO
- ZHANG DI
Assignees
- 四川长虹空调有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260129
Claims (6)
- 1. A system for quickly adapting to a change in a service, the system comprising: the system comprises a configuration file, an analysis unit, a second structure and a control unit, wherein the configuration file is used for analyzing the configuration file and generating a first structure and a second structure based on a predefined structure template, and the configuration file is used for defining a newly added or changed service function and comprises an application end function identifier, an electric control end attribute identifier and communication parameters; the application end command interpretation unit is used for resolving a control command sent by the application end into an electric control parameter based on the first structural body; the electronic control command packaging unit is used for assembling the electronic control parameters into an electronic control command and issuing the electronic control command to the electronic control terminal; the electronic control state interpretation unit is used for resolving the state information returned after the electronic control terminal executes the control command into state reporting data which can be identified by the application terminal based on the second structural body; and the electric control state reporting unit is used for sending the state reporting data to the application end.
- 2. A system for fast adaptation service altering according to claim 1, wherein the predefined fabric template comprises a function name field for storing an application side function identification, an attribute number field for storing an electronic control side attribute identification, a field for storing a communication parameter data length, and a field for storing a communication parameter value.
- 3. The system for quickly adapting to service change according to claim 2, wherein the predefined structure template further comprises an operation authority field for identifying the read-write authority of the corresponding function, and the application side command interpretation unit and the electronic control state interpretation unit determine whether to execute the analysis task by checking the operation authority field.
- 4. A system for fast adapting to a service change according to any of claims 1-3, wherein 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 quickly adapting to service change, applied to a system for quickly adapting to service change according to any one of claims 1-4, characterized in that the method comprises: step S1, defining a configuration file according to a newly added or changed service function, wherein the configuration file comprises an application end function identifier, an electric control end attribute identifier and communication parameters; S2, analyzing the configuration file based on a predefined structural body template to generate a first structural body and a second structural body, wherein the first structural body is used for storing a mapping relation from an application end function identifier to an electric control parameter, and the second structural body is used for storing a mapping relation from the electric control end attribute identifier to an application end reporting parameter; s3, receiving a control command of an application end, and analyzing the control command into an electric control parameter by inquiring the first structural body; s4, assembling the electric control parameters into an electric control command and issuing the electric control command to an electric control terminal; S5, receiving state information returned after the electric control terminal executes the control command, and analyzing the state information into state report data which can be identified by the application terminal by inquiring the second structural body; And step S6, sending the status report data to the application end.
- 6. The method for quickly adapting to service change according to claim 5, wherein the application end function identifier in the control command is used as an index when the first structure is queried, and the electric control end attribute identifier in the state information is used as an index when the second structure is queried.
Description
System and method for quickly adapting to service change Technical Field The invention mainly relates to the technical field of program testing, in particular to a system and a method for quickly adapting to service change. Background With the rapid development of the technology of the internet of things and intelligent terminals, intelligent equipment such as intelligent home appliances and intelligent hardware has increasingly abundant functions, and a system of the intelligent equipment is generally composed of a plurality of components such as equipment ends, application ends and bottom electric control modules. In order to improve the user experience and market competitiveness, equipment manufacturers need to frequently respond to third party service demands, for example, add new control functions to an application end, adjust interaction logic, adapt to new electronic control protocols, and the like. As shown in FIG. 1, in the conventional development mode, such functional changes typically require deep modification of the source code of the device-side core business logic, and the process generally includes demand analysis, source code level development, compilation construction, comprehensive testing and problem repair. This mode suffers from the following significant drawbacks: The development period is long, the cost is high, the whole system code frame needs to be adaptively modified every time the function is changed, professional developers are needed to intervene, and code writing, debugging and verification are carried out according to the process, so that the project period is prolonged, and the labor cost is increased. The stability risk is high, and unpredictable risks can be introduced by directly modifying the core source code, so that the stability of the original function can be influenced, and further, a wider regression test is required, and the test period is further prolonged. The flexibility is poor, the dependence is strong, business logic is highly coupled with the realization codes, so that the function augmentation, deletion and verification are seriously dependent on development teams, can not be rapidly configured by products or implementation personnel, and are difficult to cope with agile and changeable third party business requirements. In the prior art, some schemes for realizing partial logic externalization through configuration files or scripts exist, but the schemes are often only aimed at a single link or a specific format, and cannot be used for efficiently carrying out complex command mapping, state conversion and bidirectional communication protocol adaptation. Therefore, a system and a method for quickly, flexibly and safely adapting to the change of the third-party service function on the premise of not modifying the source code of the main body of the device are urgently needed in the field, and the contradiction between the development efficiency, the system stability and the service flexibility is solved. Disclosure of Invention The invention aims to solve the technical problem of providing a system and a method for quickly adapting service change, and aims to enable an electronic control device to quickly adapt service function change under the condition of not modifying a source code. The invention solves the technical problems by adopting the technical scheme that: In one aspect, the present invention provides a system for quickly adapting to a service change, the system comprising: the system comprises a configuration file, an analysis unit, a second structure and a control unit, wherein the configuration file is used for analyzing the configuration file and generating a first structure and a second structure based on a predefined structure template, and the configuration file is used for defining a newly added or changed service function and comprises an application end function identifier, an electric control end attribute identifier and communication parameters; the application end command interpretation unit is used for resolving a control command sent by the application end into an electric control parameter based on the first structural body; the electronic control command packaging unit is used for assembling the electronic control parameters into an electronic control command and issuing the electronic control command to the electronic control terminal; the electronic control state interpretation unit is used for resolving the state information returned after the electronic control terminal executes the control command into state reporting data which can be identified by the application terminal based on the second structural body; and the electric control state reporting unit is used for sending the state reporting data to the application end. Further, the predefined structure body template comprises a function name field for storing an application end function identifier, an attribute number field for storing an electronic control end attribute