A method and device for dynamic interface adaptation in a non-down state

Through dynamic interface configuration and dynamic caching technology, the system operation interruption caused by changes in interface protocols is solved, seamless interface adaptation is achieved, system stability and scalability is improved, and seamless switching is ensured when interface changes or new additions are performed. and efficient adaptation.

CN115580662BActive Publication Date: 2024-12-17SICHUAN JIUZHOU AIR TRAFFIC CONTROL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211173358.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2024-12-17
Estimated Expiration
2042-09-26

AI Technical Summary

Technical Problem

When the interface protocol is changed or added, existing systems can easily lead to data parsing errors and software operation abnormalities, affecting the normal operation of the information system, especially in drone control information systems, the lack of unified interface protocols and standards leads to interface form. Diversity and inconsistent communication protocols affect business efficiency and software usage experience.

Method used

Using dynamic interface configuration and dynamic cache technology, the interface class library is changed and reloaded by obtaining and storing interface configuration files, and the Class file is updated in real time, and data analysis and verification are combined with the interface class library to realize automatic perception and switching of interface protocols. , ensure that the system is seamlessly adapted when the interface changes or is added.

Benefits of technology

It realizes seamless switching of interface changes during system operation, improves system stability and scalability, reduces the risk of system operation abnormalities caused by data changes, improves adaptability to external input data, and enhances the efficiency of dynamic interface configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115580662B_ABST
    Figure CN115580662B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for dynamic interface adaptation in a non-downtime state, which obtains an interface configuration file, defines interface attributes, converts the interface configuration file, changes the interface class of the converted interface configuration file, reloads the changed interface class, and updates the Class file in real time; obtains the communication data of the input data, combines the interface class library, judges and verifies the interface configuration file, identifies the corresponding interface configuration file, performs data analysis on the interface configuration file, and distributes the analyzed data. The method uses interface dynamic configuration and dynamic caching technology to realize the non-downtime update of the system interface, uses interface dynamic adaptation to realize the perception of interface changes and interface file switching during operation, realizes dynamic interface adaptation of the system operation without downtime when the interface is changed, and achieves seamless switching when the interface changes or is added during system operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of interface adaptation, and in particular to a method and device for dynamic interface adaptation in a non-drop state. Background Art

[0002] With the continuous development of computer technology, the number and types of information system software interfaces have developed rapidly. The reliability, stability and scalability of software operation have always been important indicators for testing the performance of information systems. There is no unified interface protocol and standard for drone control information systems in China, which leads to the current situation of diverse interface forms and inconsistent communication protocols for detection, disposal and monitoring equipment for drone control. When the same drone control information system works in different modes and environments, it needs to access a variety of equipment data and distribute control data. When switching interface protocols, it is easy to cause problems such as machine crashes and software operation abnormalities that affect the normal operation of the information system, thereby affecting the business efficiency of drone control and reducing the software usage experience.

[0003] Dynamic interface adaptation means that when the external data interface protocol changes during the software operation, the software can automatically sense and match the protocol change, adapt the parsing or encoding of the new protocol data by adjusting the protocol control file inside the software, and realize the hot access of the information system to the external data under the new protocol.

[0004] In order to solve the problem of dynamic protocol access to external data of information systems, it is necessary to solve the problem of dynamic interface adaptation, data parsing and encoding without power failure when the interface changes dynamically. Summary of the invention

[0005] The technical problem to be solved by the present invention is that when the existing system is running and adapting to the modified or newly added interface protocol, it is easy to cause data parsing errors and software operation abnormalities, which can easily cause system operation interruption. The purpose is to provide a method and device for dynamic interface adaptation without crashing the machine, and use interface dynamic configuration and dynamic caching technology to realize the non-crashing update of the system interface, and use interface dynamic adaptation to realize interface change perception and interface file switching during operation, so as to achieve efficient interface adaptation, effectively solve the interface change problem during system operation, realize dynamic interface adaptation without crashing the system, and achieve seamless switching when the interface changes or new additions are added during system operation.

[0006] The present invention is achieved through the following technical solutions:

[0007] A first aspect of the present invention provides a method for dynamic interface adaptation in a non-drop state, comprising the following specific steps:

[0008] S1. Obtain an interface configuration file, define interface attributes, and store the defined interface configuration file;

[0009] S2. Convert the interface configuration file, change the interface class of the converted interface configuration file, reload the changed interface class, and update the Class file in real time;

[0010] S3. Obtain the communication data of the input data, combine with the interface class library, judge and verify the interface configuration file, identify the corresponding interface configuration file, parse the interface configuration file, and distribute the parsed data.

[0011] The present invention changes the interface class of the converted interface configuration file, reloads the changed interface class, and updates the Class file in real time, obtains the communication data of the input data, combines the interface class library, judges and verifies the interface configuration file, identifies the corresponding interface configuration file, performs data analysis on the interface configuration file, and distributes the analyzed data. The interface dynamic configuration and dynamic cache technology are used to realize the non-downtime update of the system interface, and the interface dynamic adaptation is used to realize the interface change perception and interface file switching during operation, realize efficient interface adaptation, effectively solve the interface change problem during system operation, realize the dynamic adaptation of the interface without system downtime during system operation, and achieve seamless switching when the interface changes or additions are added during system operation.

[0012] Furthermore, the S1 specifically includes:

[0013] Obtain the operation result data of the user's human-computer interaction and judge the type of operation configured in the interface file;

[0014] Binary serialize the newly added or modified interface configuration files, compress them into binary streams and store them;

[0015] Detect interface types and update interface configuration files in real time.

[0016] Further, the determining of the interface file configuration operation type includes:

[0017] If the interface type is determined to be a new interface definition, enter the interface file definition interface to fill in the property definition, communication mode definition, and interface parameter definition content;

[0018] If the interface type is detected as original interface maintenance, the interface file modification and deletion interface is entered to read the interface file to be modified from the interface configuration file storage unit to edit and delete the original interface file.

[0019] Furthermore, the S2 specifically includes:

[0020] Obtain the configuration file data of the interface configuration file in real time, and convert the serialized binary byte stream into a binary character stream;

[0021] Use JAVA reflection technology to convert character stream into JAVA entity class, perform HASH operation according to configuration file data, generate a 128-bit unique identifier as the JAVA entity class name of the interface file;

[0022] The JAVA runtime class reloading technology is used to reload the Class running files in the virtual machine, update the interface Class files in real time, and remove expired interface Class files.

[0023] Furthermore, before acquiring the configuration file data of the interface configuration file, it is necessary to start the interface file dynamic cache management thread or wait for the change drive signal sent by the interface configuration file unit, and the interface file dynamic cache management thread is a timing thread.

[0024] Furthermore, after the interface class is reloaded, the system communication mode is updated according to the communication mode defined in the interface configuration file. If the current communication mode is wrong, the configuration file data of the interface configuration file is re-read.

[0025] Furthermore, the update system communication mode includes:

[0026] Update the configuration and port parameters of TCP / IP, UDP and network middleware for network communication, update the channel and baud rate parameter information for serial communication, and switch the communication mode adaptively after the interface configuration file changes.

[0027] Further, the identifying the corresponding interface configuration file specifically includes:

[0028] Obtain an interface configuration file, obtain a communication protocol, a data frame length, and a data identification number of input data, and judge and verify the communication protocol, the data frame length, and the data identification number of the input data;

[0029] Combined with the interface class library, start the data receiving thread respectively and wait for external data input;

[0030] After receiving external data, the communication mode judgment and data identification judgment are performed respectively to identify the interface configuration file stored in the memory.

[0031] Furthermore, the data parsing of the interface configuration file and data distribution of the parsed data specifically includes:

[0032] Load the interface configuration file, build a fast parsing model, and quickly match and parse the input data according to the data structure;

[0033] Input data structure composition to the fast parsing model, and parse the corresponding output structure composition;

[0034] Data conversion is performed according to the output data structure composition, and the data converted into an internal format is distributed according to the data distribution communication method and data distribution address.

[0035] A second aspect of the present invention provides an interface dynamic adaptation device in a non-down state, comprising: an interface file configuration unit, an interface file dynamic cache unit and an interface dynamic adaptation unit.

[0036] The interface file configuration unit is used to obtain an interface configuration file, define interface attributes, and store the defined interface configuration file;

[0037] The interface file dynamic cache unit is used to convert the interface configuration file, change the interface class of the converted interface configuration file, reload the changed interface class, and update the Class file in real time;

[0038] The interface dynamic adaptation unit is used to obtain the communication protocol, data frame length and data identification number of the input data, combine with the interface class library, judge and verify the interface file, identify the corresponding interface configuration file, parse the interface configuration file through data structure comparison and parsing technology, and distribute the parsed data.

[0039] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0040] 1. The present invention can realize the modification and adaptation of the external interface during the operation of the system, thereby increasing the stability and robustness of the system operation;

[0041] 2. The present invention has a dynamic interface configuration technology, which improves the efficiency of dynamic interface configuration through visual operation;

[0042] 3. The present invention realizes the interface file modification during operation by implementing the interface file modification technology without crashing the machine, thereby reducing the configuration overhead during system operation, and making the system operation have a higher level of scalability and convenience;

[0043] 4. The present invention adopts interface dynamic adaptation technology for data analysis, which can improve the system's adaptability to external input data and reduce the risk of system operation abnormalities caused by data changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:

[0045] Figure 1 It is an operation cross-linking diagram in an embodiment of the present invention;

[0046] Figure 2 A diagram showing the functional composition of a device in an embodiment of the present invention;

[0047] Figure 3 The interface file configuration flow chart in the embodiment of the present invention;

[0048] Figure 4 This is a flowchart of dynamic caching of interface files in an embodiment of the present invention;

[0049] Figure 5 The following is a flowchart of the dynamic interface adaptation in an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0051] Example 1

[0052] like Figure 1 As shown, the present embodiment provides a method for dynamic interface adaptation in a non-down state, including the following specific steps:

[0053] S1. Obtain an interface configuration file, define interface attributes, and store the defined interface configuration file;

[0054] S2. Convert the interface configuration file, change the interface class of the converted interface configuration file, reload the changed interface class, and update the Class file in real time;

[0055] S3. Obtain the communication data of the input data, combine with the interface class library, judge and verify the interface configuration file, identify the corresponding interface configuration file, parse the interface configuration file, and distribute the parsed data.

[0056] By changing the interface class of the converted interface configuration file, reloading the changed interface class, and updating the Class file in real time, the communication data of the input data is obtained, and the interface configuration file is judged and verified in combination with the interface class library, the corresponding interface configuration file is identified, the interface configuration file is parsed, and the parsed data is distributed. The interface dynamic configuration and dynamic caching technology are used to realize the non-downtime update of the system interface, and the interface dynamic adaptation is used to realize the perception of interface changes and interface file switching during operation, to achieve efficient interface adaptation, and effectively solve the problem of interface changes during system operation. The dynamic adaptation of the interface is realized without system downtime during system operation, and seamless switching is achieved when the interface changes or additions are added during system operation.

[0057] In some possible embodiments, S1 specifically includes:

[0058] Obtain the operation result data of the user's human-computer interaction and judge the type of operation configured in the interface file;

[0059] Binary serialize the newly added or modified interface configuration files, compress them into binary streams and store them;

[0060] Detect interface types and update interface configuration files in real time.

[0061] In some possible embodiments, determining the interface file configuration operation type includes:

[0062] If the interface type is determined to be a new interface definition, enter the interface file definition interface to fill in the property definition, communication mode definition, and interface parameter definition content;

[0063] If the interface type is detected as original interface maintenance, the interface file modification and deletion interface is entered to read the interface file to be modified from the interface configuration file storage unit to edit and delete the original interface file.

[0064] In some possible embodiments, S2 specifically includes:

[0065] Obtain the configuration file data of the interface configuration file in real time, and convert the serialized binary byte stream into a binary character stream;

[0066] Use JAVA reflection technology to convert character stream into JAVA entity class, perform HASH operation according to configuration file data, generate a 128-bit unique identifier as the JAVA entity class name of the interface file;

[0067] The JAVA runtime class reloading technology is used to reload the Class running files in the virtual machine, update the interface Class files in real time, and remove expired interface Class files.

[0068] In some possible embodiments, before obtaining the configuration file data of the interface configuration file, it is necessary to start the interface file dynamic cache management thread or wait for the change drive signal sent by the interface configuration file unit. The interface file dynamic cache management thread is a timing thread.

[0069] In some possible embodiments, after the interface class is reloaded, the system communication mode is updated according to the communication mode defined in the interface configuration file. If the current communication mode is wrong, the configuration file data of the interface configuration file is reread.

[0070] In some possible embodiments, updating the system communication mode includes:

[0071] Update the configuration and port parameters of TCP / IP, UDP and network middleware for network communication, update the channel and baud rate parameter information for serial communication, and switch the communication mode adaptively after the interface configuration file changes.

[0072] In some possible embodiments, identifying the corresponding interface configuration file specifically includes:

[0073] Obtain an interface configuration file, obtain a communication protocol, a data frame length, and a data identification number of input data, and judge and verify the communication protocol, the data frame length, and the data identification number of the input data;

[0074] Combined with the interface class library, start the data receiving thread respectively and wait for external data input;

[0075] After receiving external data, the communication mode judgment and data identification judgment are performed respectively to identify the interface configuration file stored in the memory.

[0076] In some possible embodiments, parsing the interface configuration file and distributing the parsed data specifically includes:

[0077] Load the interface configuration file, build a fast parsing model, and quickly match and parse the input data according to the data structure;

[0078] Input data structure composition to the fast parsing model, and parse the corresponding output structure composition;

[0079] Data conversion is performed according to the output data structure composition, and the data converted into an internal format is distributed according to the data distribution communication method and data distribution address.

[0080] Example 2

[0081] like Figure 2As shown, this embodiment provides an interface dynamic adaptation device in a non-down state, including: an interface file configuration unit, an interface file dynamic cache unit and an interface dynamic adaptation unit.

[0082] The interface file configuration unit is used to obtain the interface configuration file, define the interface attributes, and store the defined interface configuration file;

[0083] The interface file dynamic cache unit is used to convert the interface configuration file, change the interface class of the converted interface configuration file, reload the changed interface class, and update the class file in real time;

[0084] The interface dynamic adaptation unit is used to obtain the communication protocol, data frame length and data identification number of the input data, and judge and verify the interface file in combination with the interface class library, identify the corresponding interface configuration file, parse the interface configuration file through data structure comparison and parsing technology, and distribute the parsed data.

[0085] In some possible embodiments, Figure 3 As shown, the purpose of the interface file configuration unit is to provide a way to manually define and maintain the interface configuration file, and define different field attributes, receiving and sending modes, and communication methods for different interface data. The interface file configuration is presented in the form of a visual human-computer interaction interface, and system maintenance personnel can quickly and easily configure the interface file. The interface file definition content includes: data source name, field name, field length, communication method, big-endian and small-endian formats, version number, verification method, frame identification, etc. The defined interface configuration file is binary serialized in XML or JSON format and stored in the system database or file system. Administrators can also modify, delete, and other operations on the completed interface configuration files.

[0086] like Figure 4As shown, the interface file dynamic cache unit is to maintain the latest and real-time performance of the interface file during system runtime, ensuring that the system can correctly perform interface data adaptation. The interface file dynamic cache operation is performed by setting a timing thread or receiving a driving signal from the interface file configuration module. By continuously acquiring the interface configuration file of the storage unit, the serialized binary byte stream is converted into a binary character stream, and the character stream is converted into a JAVA entity class using JAVA reflection technology. The name, version number, communication method and other contents of the interface configuration file are hashed to generate a 128-bit unique identifier as the JAVA entity class name of the interface file. The Class running file in the virtual machine is reloaded through the JAVA runtime class reloading technology, and expired Class files are removed. According to the communication method of the interface file, the current communication mode of the system is dynamically adjusted, and data communication methods and channels such as the network, serial port, and USB are turned on or off to ensure the smoothness of data transmission and reception. By dynamically caching the interface file, the interface adaptation file in the memory of the virtual machine at runtime is updated, thereby ensuring that the interface configuration file is updated and the communication method is adapted without the system crashing, and the correctness of interface data transmission and reception and adaptation at runtime is ensured.

[0087] like Figure 5 As shown, the interface dynamic adaptation unit is to complete the interface type judgment and data parsing of the external input data, and can automatically perceive the interface type change during the dynamic change of the interface, and parse the data content into the internal data format. The interface dynamic adaptation unit identifies the corresponding interface configuration file by judging and verifying the communication protocol, data frame length, data identification number and other information of the input data, and outputs the parsed data according to the output format of the control file through data structure comparison and parsing technology. The control interface file clearly stipulates the input data structure composition, the corresponding output structure composition of the analysis, the data distribution address after parsing and the data distribution communication method in the parsing process. The interface dynamic configuration unit realizes fast interface matching and data parsing of the input data by constructing a fast parsing model, and distributes the parsed data to the corresponding unit according to the data distribution method.

[0088] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for dynamic interface adaptation without dropping the device, characterized in that: The specific steps include: S1. Obtain an interface configuration file, define interface attributes, and store the defined interface configuration file; The S1 specifically includes: Obtain the operation result data of the user's human-computer interaction and judge the interface file configuration operation type: if the interface type is detected to be a new interface definition, enter the interface file definition interface to fill in the attribute definition, communication mode definition and interface parameter definition content; if the interface type is detected to be the original interface maintenance, enter the interface file change and deletion interface, read the interface file to be changed from the interface configuration file storage unit, and perform the editing and deletion operations on the original interface file; Binary serialize the newly added or modified interface configuration files, compress them into binary streams and store them; Detect interface type and update interface configuration files in real time; S2. Convert the interface configuration file, change the interface class of the converted interface configuration file, reload the changed interface class, and update the Class file in real time; S3. Obtain the communication data of the input data, combine the interface class library, judge and verify the interface configuration file, identify the corresponding interface configuration file, parse the interface configuration file, and distribute the parsed data. The parsed data is output according to the output format of the interface configuration file through the data structure comparison and parsing technology. The interface configuration file clearly stipulates the input data structure composition, the corresponding output structure composition, the parsed data distribution address and the data distribution communication method in the parsing process. The interface dynamic configuration unit realizes fast interface matching and data parsing of the input data by building a fast parsing model, and distributes the parsed data to the corresponding unit according to the data distribution method. The identifying of the corresponding interface configuration file specifically includes: Obtain an interface configuration file, obtain a communication protocol, a data frame length, and a data identification number of input data, and judge and verify the communication protocol, the data frame length, and the data identification number of the input data; Combined with the interface class library, start the data receiving thread respectively and wait for external data input; After receiving external data, the communication mode and data identification are judged respectively, and the interface configuration file stored in the memory is identified; The data parsing of the interface configuration file and data distribution of the parsed data specifically includes: Load the interface configuration file, build a fast parsing model, and implement fast interface matching and data parsing of input data according to the data structure composition; Input data structure composition to the fast parsing model, and parse the corresponding output structure composition; Data conversion is performed according to the output data structure composition, and the data converted into an internal format is distributed according to the data distribution communication method and data distribution address.

2. The method for dynamic interface adaptation in a non-dropping state according to claim 1, characterized in that: The S2 specifically includes: Obtain the configuration file data of the interface configuration file in real time, and convert the serialized binary byte stream into a binary character stream; Use JAVA reflection technology to convert character stream into JAVA entity class, perform HASH operation according to configuration file data, generate a 128-bit unique identifier as the JAVA entity class name of the interface file; The JAVA runtime class reloading technology is used to reload the Class running files in the virtual machine, update the interface Class files in real time, and remove expired interface Class files.

3. The method for dynamic interface adaptation in a non-dropping state according to claim 2, characterized in that: Before acquiring the configuration file data of the interface configuration file, it is necessary to start the interface file dynamic cache management thread or wait for the change drive signal sent by the interface configuration file unit. The interface file dynamic cache management thread is a timing thread.

4. The method for dynamic interface adaptation in a non-dropping state according to claim 2, characterized in that: After the interface class is reloaded, the system communication mode is updated according to the communication mode defined in the interface configuration file. If the current communication mode is wrong, the configuration file data of the interface configuration file is reread.

5. The method for dynamic interface adaptation in a non-dropping state according to claim 4, characterized in that: The update system communication mode includes: Update the configuration and port parameter information of TCP / IP, UDP and network middleware for network communication, update the channel and baud rate parameter information for serial communication, and switch the communication mode by adaptively changing the interface configuration file.

6. A device for dynamically adapting an interface in a non-dropping state, applied to the method for dynamically adapting an interface in a non-dropping state as claimed in any one of claims 1 to 5, characterized in that: include: An interface file configuration unit, an interface file dynamic cache unit and an interface dynamic adaptation unit; The interface file configuration unit is used to obtain an interface configuration file, define interface attributes, and store the defined interface configuration file; The interface file dynamic cache unit is used to convert the interface configuration file, change the interface class of the converted interface configuration file, reload the changed interface class, and update the Class file in real time; The interface dynamic adaptation unit is used to obtain the communication protocol, data frame length and data identification number of the input data, combine with the interface class library, judge and verify the interface file, identify the corresponding interface configuration file, parse the interface configuration file through data structure comparison and parsing technology, and distribute the parsed data.