Method for realizing lightweight client data interaction structure of video fusion platform
Through layered structure and packaging technology, each layer of the client is independently encapsulated and the communication mechanism is optimized, which solves the problems of high maintenance costs and structural redundancy of PC clients in the existing technology, realizes rapid iteration and efficient maintenance, and improves the system maintainability and scalability.
Patent Information
- Application Number
- CN202411765671.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The existing video convergence platform PC client design has problems such as high maintenance costs, high coupling, structural redundancy and difficulty in iteration, resulting in high modification and maintenance costs, poor system maintenance, and difficult to add new module functions.
Using hierarchical structure design and packaging technology, the client is divided into user layer, intermediate layer and communication layer. Each layer is independently encapsulated into a library, optimized the communication mechanism, and stripped off the communication data into an independent packaging library, making the client more lightweight , you only need to modify the library at the corresponding level to achieve rapid iteration.
It significantly improves the maintainability, flexibility and scalability of the system, reduces the difficulty and workload of modification, avoids the phenomenon of "touching the whole body", shortens the modification cycle, and improves the development efficiency and overall code. efficiency.
Smart Images

Figure CN119232986A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of client design in the video surveillance industry, and in particular relates to a method for realizing a lightweight client data interaction structure of a video fusion platform. Background Art
[0002] As the PC client of the video fusion platform, once its design is finalized, modifying its functions or styles again will face the challenges of a long period and high workload, which is almost equivalent to rebuilding the entire client. The design of the PC client in the existing related technology mixes multiple links such as UI input, data encapsulation, and communication together, making each module a separate individual. Therefore, if the client style needs to be replaced, the UI interface must be redesigned, the data must be repackaged, and the relevant communication data must be adjusted to ensure the coordination of the entire system.
[0003] If you want to modify the functions and styles of the client, since the client mixes all the processes together, the existing related technologies have at least the following shortcomings: 1. High maintenance cost: From the perspective of maintenance cost, since the client design is highly correlated, any small modification to the UI may trigger a comprehensive adjustment of the entire system, including style, data processing, communication and other aspects. This "one move affects the whole system" feature not only increases the workload of modification, but also increases the difficulty of modification; 2. Clumsy structure: The client structure is clumsy. The high coupling and low cohesion of data lead to unclear system layering. Various modules are often mixed with multiple functions such as UI design, data processing and communication, which makes the coupling between modules high; 3. Structural redundancy. There is a problem of structural redundancy in the existing client structure. For example, module A implements a communication method TA according to the business, and module B also implements a communication method TB according to the business. TA and TB have something in common, but they are implemented separately, reinventing the wheel. It is only because of the distinction between businesses that they cannot be unified. There is a lot of code written, but the structure is very redundant. Because different modules may use similar communication methods, but fail to achieve a unified standard, the code is highly duplicated and the structure is redundant; 4. In terms of adding new module functions, due to the high coupling between existing modules, it is difficult to separate a module and reuse it in other scenarios. This requires developers to make comprehensive modifications from top to bottom when adding new functions, which increases the complexity and cost of development; 5. The division of responsibilities between modules is also unclear. Some modules may assume multiple unrelated responsibilities, making the purpose and function of the modules unclear. This not only reduces the maintainability of the system, but also increases the risk of system failure.
[0004] In summary, the existing PC client of the video fusion platform has many challenges and problems in design and maintenance. It is necessary for technicians to provide a new solution to reconstruct and optimize the client communication mode and other aspects to improve the maintainability, scalability and performance of the system. Summary of the invention
[0005] In view of the limitations of the prior art, the present invention proposes a method for implementing a lightweight client data interaction structure of a video fusion platform. The client designed by the method adopts a layered structure, and only the corresponding layer needs to be modified without comprehensive adjustment, thereby achieving rapid iteration. This method solves the problems of high maintenance cost, complex and redundant structure, and difficulty in adding new modules of traditional clients. Through the implementation method of the present invention, an innovative packaging technology is provided, which significantly improves the maintainability, flexibility and scalability of the system.
[0006] To achieve the above object, the technical solution adopted by the present invention is: a method for implementing a lightweight client data interaction structure of a video fusion platform, characterized in that it includes the following steps: Design a hierarchical structure for the client to achieve hierarchical structure; Encapsulate each layer of structure to form an independent encapsulation library; Optimize the communication mechanism within the client, strip the communication data, and independently create a package library for data communication; make the client itself lighter, thereby achieving rapid function iteration; If a certain layer structure needs to be modified, an independent data communication encapsulation library can be used for communication to replace and / or modify the encapsulation library of the layer structure without changing other structures in the client.
[0007] Furthermore, the hierarchical structure of the client includes at least a user layer and an intermediate layer; The user layer at least includes a UI layer, a data management layer and a data request layer; wherein The UI layer is used to interact with users. Users can input information and obtain returned information. The UI layer can display the returned information. The data management layer is used to manage the data input by users, construct data structures to store user data, and process data returned from the server. The data request layer is used to call the interface information of the middle layer and establish a connection bridge with the middle layer. The intermediate layer at least includes a communication data management layer and a communication layer; wherein The communication data management layer: unifies data in XML format to facilitate the transmission and analysis of network data; The communication layer is a bridge for communicating with the server; the communication layer includes a small data volume communication layer and a large data volume communication layer.
[0008] Furthermore, the client of the layered structure design includes at least the following data interaction methods: The user inputs data through the UI layer, and the UI layer transmits the user input data to the data management layer; The data management layer stores user data in the data management layer and sends the request data to the data request layer; The data request layer makes a data request call interface to the communication data management layer in the middle layer; If it is a user data request, the communication data management layer sends the user data request in XML format to the small data communication layer, and then sends the request data to the server through the small data communication layer; If it is a video data request, the communication data management layer sends the video data request in XML format to the large data volume communication layer, and then sends the request data to the server through the large data volume communication layer; The server returns data to the data management layer layer by layer, and presents it to the UI layer through the data management layer.
[0009] Furthermore, the specific implementation method includes at least the following: The UI layer, data management layer, data request layer, communication data management layer, and communication layer are each encapsulated into libraries; The UI layer loads the library of the data management layer DataManager and calls the interface DataManagerFunA() provided by the data management layer; The data management layer loads the library of the data request layer DataRequest and calls the interface DataRequestFunB() provided by the data request layer; The data request layer loads the library of the communication data management layer ComDataManger and calls the interface ComDataMangerFunC() provided by the communication data management layer; The communication data management layer loads the library of the communication layer ComData and calls the interface ComDataFunD() provided by the data communication layer; After each layer is independently encapsulated into a library, if a certain layer needs to be adjusted, it is only necessary to make corresponding modifications through the communication data management library layer; this method ensures that only the corresponding independent packaged library needs to be modified, and there is no need to make comprehensive adjustments to the entire client, thereby achieving the effect of rapid iteration.
[0010] Furthermore, the implementation of the new module includes at least the following steps: New module UI design: When there is a new module requirement, first carry out UI design, and then implement the corresponding interface based on the UI design; Implementation of UI interface: The implementation of UI interface is divided into at least UI level and UI data management level. The UI layer is responsible for presenting the interface content to the user, and does not involve the data information generated by user interaction; for example, in the login module, there will be interface elements such as account input box and password input box, but they are only the interface displayed to the user for operation, and do not contain the data actually entered by the user; The UI data management layer is responsible for the unified management of the data input by users, including the account and / or password information input by users. After the relevant work at the UI layer and UI data management layer is completed, the interfaces of other layers can be called to perform data transmission and data request.
[0011] The present invention adopts the above technical solution, which has at least the following beneficial effects: 1. In the existing technical environment, due to the tight coupling of the client, any minor changes, such as modification of the UI interface, may lead to comprehensive adjustments to the overall architecture, style, data processing and communication process; every design and modification must be formatted, and this extensive modification requirement not only significantly increases the workload, but also greatly increases the difficulty of modification; In response to this problem, the present invention has brought innovation to the software development process. By introducing the concept of structural layered design, the present invention allows developers to only make adjustments to specific layers or modules when faced with modification requirements, without having to make large-scale adjustments to the entire system. This avoids large-scale work. This design strategy significantly improves the maintainability and scalability of the software, provides the development team with the ability to flexibly respond to changes in requirements, and supports the implementation of rapid iteration and continuous integration; Specifically, the hierarchical structure ensures that the entire requirement can be met by modifying only one library. It does not require the entire client to be modified, which is easy to maintain, with a lightweight structure and no data redundancy. It effectively curbs the phenomenon of "a single move affects the entire body" and avoids chain reactions caused by local changes. This feature greatly shortens the modification cycle, improves development efficiency, makes the software development process smoother, and can better meet the rapidly changing needs of the market and users.
[0012] 2. In the implementation process of the present invention, the processing logic of communication data is separated from the client and independently developed into a special encapsulation library. Such a design not only makes the client itself more lightweight, but also greatly improves the speed of function iteration. Since the communication logic is encapsulated in an independent library, the other parts of the client do not need to be modified to achieve rapid deployment and update of new functions. This design method effectively isolates the dependencies between functional modules, allowing the client to focus more on the optimization of the user interface and interaction logic without having to worry about changes in the underlying communication mechanism.
[0013] 3. The introduction of the package library significantly improves the overall efficiency of software development. When using the package library, developers only need to call the interface functions provided by the library without having to deeply understand its internal implementation details. This approach avoids the repeated development of code for the same function, the so-called "reinventing the wheel", thereby saving a lot of development time and resources. In addition, the modular design of the package library also simplifies code maintenance and reduces maintenance costs. When the package library needs to be updated or upgraded, developers can choose the appropriate version to replace it without affecting other code parts that depend on the library. This flexibility and maintainability provide a solid foundation for the long-term development of software. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0015] Figure 1 It is a flowchart for realizing the lightweight client data interaction structure of the present invention.
[0016] Figure 2 It is a schematic diagram of the hierarchical structure of the client of the present invention.
[0017] Figure 3 It is a schematic diagram of data interaction after the present invention adopts a hierarchical structure.
[0018] Figure 4 This is a schematic diagram of existing client data interaction.
[0019] Figure 5 This is a schematic diagram of client data interaction using the present invention. DETAILED DESCRIPTION
[0020] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0021] See also Figure 1 This embodiment provides a method for implementing a lightweight client data interaction structure of a video fusion platform, which is characterized by comprising the following steps: Design a hierarchical structure for the client to achieve hierarchical structure; Encapsulate each layer of structure to form an independent encapsulation library; Optimize the communication mechanism within the client, strip the communication data, and independently create a package library for data communication; make the client itself lighter, thereby achieving rapid function iteration; If a certain layer structure needs to be modified, an independent data communication encapsulation library can be used for communication to replace and / or modify the encapsulation library of the layer structure without changing other structures in the client.
[0022] like Figure 2 As shown, as an implementation mode, the hierarchical structure of the client in this embodiment includes at least a user layer and an intermediate layer; The user layer at least includes a UI layer, a data management layer and a data request layer; wherein The UI layer is used to interact with users. Users can input information and obtain returned information. The UI layer can display the returned information. The data management layer is used to manage the data input by users, construct data structures to store user data, and process data returned from the server. The data request layer is used to call the interface information of the middle layer and establish a connection bridge with the middle layer. The intermediate layer at least includes a communication data management layer and a communication layer; wherein The communication data management layer: unifies data in XML format to facilitate the transmission and analysis of network data; The communication layer is a bridge for communicating with the server; the communication layer includes a small data volume communication layer and a large data volume communication layer.
[0023] The communication layer is divided into two levels to deal with the problem that may be caused when the amount of interactive data is too large, that is, the client is delayed in receiving data, which in turn causes data loss. In this embodiment, the communication layer with a smaller amount of data involves data information interacting with the user, such as the input of account numbers and passwords. The communication layer with a larger amount of data involves continuous large-scale data interaction such as video streaming.
[0024] like Figure 2 and Figure 3 As shown, as an implementation mode, the client of the hierarchical structure design in this embodiment has at least the following steps: The user inputs data through the UI layer, and the UI layer transmits the user input data to the data management layer; The data management layer stores user data in the data management layer and sends the request data to the data request layer; The data request layer makes a data request call interface to the communication data management layer in the middle layer; If it is a user data request, the communication data management layer sends the user data request in XML format to the small data communication layer, and then sends the request data to the server through the small data communication layer; If it is a video data request, the communication data management layer sends the video data request in XML format to the large data volume communication layer, and then sends the request data to the server through the large data volume communication layer; The server returns data to the data management layer layer by layer, and presents it to the UI layer through the data management layer.
[0025] If there is a change in the corresponding layer in the client structure provided in this embodiment, the encapsulation library of the corresponding layer is directly replaced without changing other structures.
[0026] like Figure 5 As shown, the specific implementation method in this embodiment includes at least the following: The UI layer, data management layer, data request layer, communication data management layer and communication layer are all encapsulated into libraries; The UI layer loads the library of the data management layer DataManager and calls the interface DataManagerFunA() provided by the data management layer; The data management layer loads the library of the data request layer DataRequest and calls the interface DataRequestFunB() provided by the data request layer; The data request layer loads the library of the communication data management layer ComDataManger and calls the interface ComDataMangerFunC() provided by the communication data management layer; The communication data management layer loads the library of the communication layer ComData and calls the interface ComDataFunD() provided by the data communication layer; After each layer is independently encapsulated into a library, if a certain layer needs to be adjusted, it is only necessary to make corresponding modifications through the communication data management library layer; this method ensures that only one library needs to be modified to meet the overall needs, without the need to make comprehensive adjustments to the entire client, achieving the effect of rapid iteration.
[0027] Application scenario 1: Due to a certain requirement, the server changes the original data parsing and packaging format from XML to Json. In order to use it normally, the client also needs to change the data packaging format from XML to Json.
[0028] like Figure 4 As shown, if the old framework is used, the data input from the UI and each data interface must convert XML into a Json structure. In this scenario, an example of the client login situation is given: For example: client login status; Username and password:<UserName= Arges, Password=123456> , first you need to modify it from XML format to json format: Account password: {UserName: Arges, Password: 123456}, then the server receives the account password signaling sent by the client and parses it; Graphic verification code:<PicCode = 1234> First, you need to modify it from XML format to json format: Graphic verification code {PicCode: 1234}, and then the server receives the graphic verification code signaling sent by the client and parses it; SMS verification code<SMSCode = 654321> First, you need to modify it from XML format to json format: SMS verification code {SMSCode: 654321}, and then the server receives the SMS verification code signaling sent by the client for parsing.
[0029] According to the attached Figure 4 As can be clearly seen from the above description, the existing old framework implementation requires a format adjustment for each place that needs to be modified. Given the architectural characteristics of the existing client, any modification to the UI will cause a global chain reaction. Therefore, once the user interface needs to be changed, the entire system must be fully updated. This includes styles, data processing, and communication processes. Such modifications not only require a huge workload, but also increase the complexity of the modification.
[0030] It should be noted that the account, password, SMS verification and other data interacting with the backend mentioned in the above embodiments need to be adjusted one by one in the old client. In the existing processing method, all data related to the client backend communication must be modified one by one.
[0031] like Figure 5 As shown, the same is required by application scenario 1. The client implemented by the lightweight client data interaction structure of the present invention is implemented in the following manner: The client provided in this embodiment adopts a new communication mechanism internally, strips the communication data, and independently creates a package library for data communication; this makes the client itself more lightweight, thereby achieving rapid function iteration; if a certain layer of structure needs to be modified, the independent data communication package library can be used for communication, replacing and / or modifying the package library of the layer structure without changing other structures in the client.
[0032] The UI layer loads the library of the data management layer DataManager and calls the interface DataManagerFunA() provided by the data management layer; for example: DataManagerFunA(UserName, Password, PicCode, SMSCode); The data management layer loads the library of the data request layer DataRequest and calls the interface DataRequestFunB() provided by the data request layer; for example: DataRequestFunB(UserName, Password, PicCode, SMSCode); The data request layer loads the library of the communication data management layer ComDataManger and calls the interface ComDataMangerFunC() provided by the communication data management layer; for example: ComDataMangerFunC(UserName, Password, PicCode, SMSCode); The communication data management layer loads the library of the communication layer ComData and calls the interface ComDataFunD() provided by the data communication layer; for example: ComDataFunD(UserName, Password, PicCode, SMSCode); After each layer is independently encapsulated into a library, if a certain layer needs to be adjusted, it is only necessary to make corresponding modifications through the communication data management library layer; this method ensures that only the corresponding independent packaged library needs to be modified, and there is no need to make comprehensive adjustments to the entire client, thereby achieving the effect of rapid iteration.
[0033] Call the management library of the data management layer: ComDataMangerFunC(UserName, Password, PicCode, SMSCode) { <UserName= Arges, Password=123456> <PicCode = 1234> <SMSCode = 654321> } After modification: ComDataMangerFunC(UserName, Password, PicCode, SMSCode) { {UserName: Arges, Password: 123456} {PicCode: 1234} {SMSCode: 654321} }.
[0034] Before modification, it is in XML format: <UserName= rges,Password=123456> <PicCode = 1234> <SMSCode = 654321> After modification, it is in Json format: {UserName : Arges,Password : 123456} {PicCode : 1234} {SMSCode : 654321} The server receives the account and password signaling, graphic verification code signaling, and SMS verification code signaling sent by the client and parses them.
[0035] exist Figure 5 In the description of , an efficient and structured data management method is clearly pointed out: that is, to encapsulate the data at each level into an independent library. When faced with the need to change the format, such as converting from XML format to Json format, only the communication data management library needs to be adjusted accordingly without touching the code logic of the upper or lower layers. This design strategy significantly simplifies the change process, and only needs to focus on the modification of a single library to meet the overall needs, thus avoiding extensive and complex adjustments to the entire client. This not only improves the maintainability of the system, but also ensures the compactness of the structure and the simplicity of data, effectively preventing the occurrence of data redundancy.
[0036] Although the embodiments of the present invention have been shown and described above, it will be appreciated that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, substitute and vary the above embodiments within the scope of the present invention.
Claims
1. A method for implementing a lightweight client data interaction structure of a video fusion platform, characterized in that: The steps include: Design a hierarchical structure for the client to achieve hierarchical structure; Encapsulate each layer of structure to form an independent encapsulation library; Optimize the communication mechanism within the client, strip the communication data, and independently create a package library for data communication; make the client itself lighter, thereby achieving rapid function iteration; If a certain layer structure needs to be modified, an independent data communication encapsulation library can be used for communication to replace and / or modify the encapsulation library of the layer structure without changing other structures in the client.
2. The method according to claim 1, characterized in that: The hierarchical structure of the client includes at least a user layer and an intermediate layer; The user layer at least includes a UI layer, a data management layer and a data request layer; in The UI layer is used to interact with users. Users can input information and obtain returned information. The UI layer can display the returned information. The data management layer is used to manage the data input by users, construct data structures to store user data, and process data returned from the server. The data request layer is used to call the interface information of the middle layer and establish a connection bridge with the middle layer. The intermediate layer at least includes a communication data management layer and a communication layer; wherein The communication data management layer: unifies data in XML format to facilitate the transmission and analysis of network data; The communication layer is a bridge for communicating with the server; the communication layer includes a small data volume communication layer and a large data volume communication layer.
3. The method according to claim 2, characterized in that: The client of the layered structure design includes at least the following data interaction methods: The user inputs data through the UI layer, and the UI layer transmits the user input data to the data management layer; The data management layer stores user data in the data management layer and sends the request data to the data request layer; The data request layer makes a data request call interface to the communication data management layer in the middle layer; If it is a user data request, the communication data management layer sends the user data request in XML format to the small data communication layer, and then sends the request data to the server through the small data communication layer; If it is a video data request, the communication data management layer sends the video data request in XML format to the large data volume communication layer, and then sends the request data to the server through the large data volume communication layer; The server returns data to the data management layer layer by layer, and presents it to the UI layer through the data management layer.
4. The method according to claim 3, characterized in that: The specific implementation methods include at least the following: The UI layer, data management layer, data request layer, communication data management layer, and communication layer are each encapsulated into libraries; The UI layer loads the library of the data management layer DataManager and calls the interface DataManagerFunA() provided by the data management layer; The data management layer loads the library of the data request layer DataRequest and calls the interface DataRequestFunB() provided by the data request layer; The data request layer loads the library of the communication data management layer ComDataManger and calls the interface ComDataMangerFunC() provided by the communication data management layer; The communication data management layer loads the library of the communication layer ComData and calls the interface ComDataFunD() provided by the data communication layer; After each layer is independently encapsulated into a library, if a certain layer needs to be adjusted, it is only necessary to make corresponding modifications through the communication data management library layer; this method ensures that only the corresponding independent packaged library needs to be modified, and there is no need to make comprehensive adjustments to the entire client, thereby achieving the effect of rapid iteration.
5. The method according to claim 4, characterized in that: The implementation of the new module includes at least the following steps: New module UI design: When there is a new module requirement, first carry out UI design, and then implement the corresponding interface based on the UI design; Implementation of UI interface: The implementation of UI interface is divided into at least UI level and UI data management level. The UI layer is responsible for presenting the interface content to the user, and does not involve the data information generated by user interaction; for example, in the login module, there will be interface elements such as account input box and password input box, but they are only the interface displayed to the user for operation, and do not contain the data actually entered by the user; The UI data management layer is responsible for the unified management of the data input by users, including the account and / or password information input by users. After the relevant work at the UI layer and the UI data management layer is completed, the method provided in claim 3 or claim 4 can be used to call the interface of other layers to perform data transmission and data request.
Citation Information
Patent Citations
Database access agent method and system based on SSL / XML
CN101848245A
IMS soft terminal and communication method thereof
CN102045330A
Achievement method of client side platform and client side platform
CN103036917A
Rich client platform dynamic behavior device and rich client platform dynamic behavior method
CN103631663A
A linear expanding communication method for a client application program engine
CN109343969A