Real-time Synchronization Method, Device and Storage Medium for Toll Terminals in Highway Toll Systems

By building SignalR hub and multi-terminal interface service MTCUIService in the highway toll system, real-time synchronization and decoupling of multi-terminal interfaces in the highway toll system is realized, solving the problem of difficulty in modifying traditional C/S systems and interface update conflicts, improving the system's real-time and cross-platform capabilities.

CN116052296BActive Publication Date: 2025-07-08广东利通科技投资有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310180780.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2025-07-08
Estimated Expiration
2043-03-01

AI Technical Summary

Technical Problem

In the existing highway toll system, the service processing and UI code of the traditional C/S high-speed lane toll software system are coupled to each other, making it difficult to modify and prone to failure. There are real-time and failed retry problems when multiple users operate at the same time.

Method used

The SignalR hub and multi-terminal interface service class MTCUIService are built on the server side, and communication pipelines are established through HubService instances and Context objects, real-time synchronization and decoupling of interface data, streaming with MessagePack, and update interface data by calculating the human-computer interaction influence degree Ci selection.

Benefits of technology

It realizes consistent synchronization of multi-terminal interfaces, reduces modification difficulty and waiting time, improves the fluency of human-computer interaction and the cross-platform capability of the system, and solves interface update conflicts under multi-user operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116052296B_ABST
    Figure CN116052296B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and storage medium for real-time synchronization of toll terminals in a highway toll collection system. The highway lane toll collection system includes a server and N toll terminals. The method includes: constructing a SignalR hub on the server, constructing a multi-terminal interface service class MTCUIService, and the MTCUIService maintains the interface data of the lane toll collection software on the N toll terminals; when it is detected that the interface data is updated, based on the IDs of the N toll terminals, construct a HubService instance corresponding to each toll terminal based on the SignalR hub; construct a Context object in the SignalR hub, and based on the Context object, enable each toll terminal to establish a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance, and the updated interface data is transmitted to the corresponding toll terminal through the corresponding communication pipeline, so that the interfaces on the N toll terminals are synchronized and consistent, and no conflict occurs during the update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent transportation, and particularly to a method, device and storage medium for real-time synchronization of a toll terminal in a highway toll collection system. Background Art

[0002] In the prior art, in the current traditional C / S high-speed lane toll collection software system, the business processing and UI code are mutually coupled, which is difficult to modify and prone to failures. If it is changed to the form of a traditional WebApi call interface, although decoupling can be achieved, problems such as real-time performance and failure retry will occur, and polling is required for front-end and back-end interaction, which will consume a large amount of performance.

[0003] In the prior art, when multiple users operate simultaneously, the technical problem of interface update, that is, which user's operation is selected as the updated interface, is also a technical challenge. Summary of the Invention

[0004] In view of one or more of the above technical defects in the prior art, the present invention proposes the following technical solutions.

[0005] A method for real-time synchronization of a toll terminal in a highway toll collection system, wherein the highway lane toll collection system includes a server and N toll terminals, N is greater than or equal to 2, and the method includes:

[0006] A construction step of constructing a SignalR hub on the server and constructing a multi-terminal interface service class MTCUIService, where the MTCUIService is used to place code for the server to push interface data to the N toll terminals, and the MTCUIService maintains the interface data of the lane toll collection software on the N toll terminals;

[0007] A detection step of, when detecting that the interface data is updated, obtaining the IDs of the N toll terminals, and constructing a HubService instance corresponding to each toll terminal based on the IDs of the N toll terminals based on the SignalR hub, where the HubService instance of each toll terminal is used to communicate with the corresponding toll terminal;

[0008] A synchronization step of constructing a Context object in the SignalR hub, and based on the Context object, enabling each toll terminal to establish a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance, and transmitting the updated interface data to the corresponding toll terminal through the corresponding communication pipeline, so that the interfaces on the N toll terminals are synchronized and consistent.

[0009] Further, the method for detecting that the interface data is updated is as follows: detecting whether the interface data is changed due to business logic through the MTCUIService on the server; or, the user sends an update detection instruction to the server at any toll collection terminal to detect whether the interface data is updated.

[0010] Further, the operation that causes the interface data to change due to business logic is as follows: when the user performs human-computer interaction with the lane toll collection software on at least one of the N toll collection terminals, data interaction is performed with the business logic on the server, thereby causing the interface data to be updated.

[0011] Further, the communication pipeline transmits the updated interface data to the corresponding toll collection terminal through the streaming transmission of MessagePack to synchronize the lane toll collection software on each toll collection terminal.

[0012] Further, at least one of the N toll collection terminals is of a different type from other terminals.

[0013] Further, a proxy layer is provided between the N toll collection terminals and the server, and the N toll collection terminals and the server call each other's functions through the proxy layer.

[0014] Further, when the user simultaneously performs human-computer interaction with the lane toll collection software on M of the N toll collection terminals, data interaction is performed with the business logic on the server, and the method for determining the updated interface data is as follows:

[0015] Calculate the influence degree Ci of the human-computer interaction of the lane toll collection software business on each toll collection terminal on the business logic, and select the interface data whose change is caused by the business logic corresponding to the largest Ci value as the updated interface data, where the calculation method of Ci is:

[0016]

[0017] where, w1, w1 are weight values, v i is the change amount of the interface data caused by human-computer interaction, l i is the number of business logics called by the human-computer interaction on one terminal, N≥M≥2, M≥i≥1.

[0018] The present invention also provides a toll collection terminal real-time synchronization device in a highway toll collection system. The highway lane toll collection system includes a server and N toll collection terminals, where N is greater than or equal to 2. The device includes:

[0019] Building unit: Build a SignalR hub on the server side, and build a multi-terminal interface service class MTCUIService. The MTCUIService is used to place the code for the server to push interface data to the N toll collection terminals, and the MTCUIService maintains the interface data of the lane toll collection software on the N toll collection terminals.

[0020] Detection unit: When it is detected that the interface data is updated, obtain the IDs of the N toll collection terminals, and based on the IDs of the N toll collection terminals, build a HubService instance corresponding to each toll collection terminal based on the SignalR hub. The HubService instance of each toll collection terminal is used to communicate with the corresponding toll collection terminal.

[0021] Synchronization unit: Build a Context object in the SignalR hub, and based on the Context object, enable each toll collection terminal to establish a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance. The updated interface data is transmitted to the corresponding toll collection terminal through the corresponding communication pipeline, so that the interfaces on the N toll collection terminals are synchronized.

[0022] Furthermore, the method for detecting that the interface data is updated is as follows: Detect whether the interface data has changed due to business logic through the MTCUIService on the server side; or, the user sends an update detection instruction to the server from any toll collection terminal to detect whether the interface data is updated.

[0023] Furthermore, the operation that causes the interface data to change due to business logic is as follows: When the user interacts with the lane toll collection software on at least one of the N toll collection terminals, data interaction is performed with the business logic on the server side, thereby causing the interface data to be updated.

[0024] Furthermore, the communication pipeline transmits the updated interface data to the corresponding toll collection terminal through the streaming transmission of MessagePack to synchronize the lane toll collection software on each toll collection terminal.

[0025] Furthermore, the type of at least one of the N toll collection terminals is different from that of other terminals.

[0026] Furthermore, a proxy layer is provided between the N toll collection terminals and the server side, and the N toll collection terminals and the server side call each other's functions through the proxy layer.

[0027] Further, when a user simultaneously performs human-computer interaction with the lane toll software on M of the N toll collection terminals, and conducts data interaction with the business logic on the server, the method for determining the updated interface data is as follows:

[0028] Calculate the influence degree Ci of the human-computer interaction of the lane toll software service on each toll collection terminal on the business logic, and select the interface data whose change is caused by the business logic corresponding to the maximum Ci value as the updated interface data. Among them, the calculation method of Ci is:

[0029]

[0030] where w1 and w2 are weight values, v i is the change amount of the interface data caused by the human-computer interaction, and l i is the number of business logics called by the human-computer interaction on one terminal. N≥M≥2, M≥i≥1.

[0031] The present invention also provides a computer-readable storage medium, on which computer program code is stored. When the computer program code is executed by a computer, the method described above is executed.

[0032] The technical effect of the present invention lies in: A real-time synchronization method, device and storage medium for a toll terminal in a highway toll collection system. The highway lane toll collection system includes a server and N toll terminals, where N is greater than or equal to 2. The method includes: A construction step S101, constructing a SignalR hub on the server, and constructing a multi-terminal interface service class MTCUIService. The MTCUIService is used to place the code for the server to push interface data to the N toll terminals, and the MTCUIService maintains the interface data of the lane toll collection software on the N toll terminals; A detection step S102, when it is detected that the interface data is updated, obtaining the IDs of the N toll terminals, and constructing a HubService instance corresponding to each toll terminal based on the IDs of the N toll terminals based on the SignalR hub. The HubService instance of each toll terminal is used to communicate with the corresponding toll terminal; A synchronization step S103, constructing a Context object in the SignalR hub, and based on the Context object, enabling each toll terminal to establish a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance. The updated interface data is transmitted to the corresponding toll terminal through the corresponding communication pipeline, so that the interfaces on the N toll terminals are synchronized and consistent.In the present invention, to solve the defects that in the prior art, the business processing and UI code of the traditional C / S high-speed lane toll software system are mutually coupled, it is difficult to modify, and faults are likely to occur, a SignalR hub is first built on the server side, and a multi-terminal interface service class MTCUIService is built. The MTCUIService is used to place the code for the server to push interface data to the N toll terminals, and the MTCUIService maintains the interface data of the lane toll software on the N toll terminals. When it is detected that the interface data is updated, based on the IDs of the N toll terminals, HubService instances corresponding to each toll terminal are built based on the SignalR hub. The HubService instance of each toll terminal is used to communicate with the corresponding toll terminal. Then, based on the Context object, each toll terminal establishes a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance. The updated interface data is transmitted to the corresponding toll terminal through the corresponding communication pipeline, so that the interfaces on the N toll terminals are synchronized and consistent. Thus, through the multi-terminal interface service class MTCUIService and HubService instances, the program codes on the server side and the toll terminals are decoupled, enabling one server to support multiple toll terminals. When the interface on one toll terminal changes, the display interfaces on other terminals are synchronously updated, making the interface displays of the toll terminals consistent, that is, one back-end transaction server corresponds to N front-end lane toll software clients. When each front-end lane toll software client conducts human-computer interaction, it will interact with the business logic of the back-end transaction server. At the same time, the back-end transaction server will notify each front-end lane toll software client of the changes resulting from the logical interaction, keeping the interfaces of each front-end lane toll software client strongly consistent, providing an important basis for the later cloud-based toll software, and with a fast update speed. In the present invention, after the business logic of the back-end transaction service changes, each front-end lane toll software client will be synchronized through the streaming transmission of MessagePack, reducing the waiting time and making the human-computer interaction more fluent. The present invention solves the technical problem of interface update when multiple users operate simultaneously, that is, which user's operation is selected as the updated interface. In the present invention, the influence degree Ci of the human-computer interaction of the lane toll software business on each toll terminal on the business logic is calculated, and the interface data resulting from the change of the business logic corresponding to the largest Ci value is selected as the updated interface data. The influence degree Ci is calculated based on the amount of change in the interface data caused by the human-computer interaction and the number of business logics invoked by the human-computer interaction, and a specific calculation formula is proposed, solving the update conflict problem. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Other features, objects, and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments read in conjunction with the accompanying drawings.

[0034] Figure 1 It is a flowchart of a real-time synchronization method for a toll collection terminal in a highway toll collection system according to an embodiment of the present invention.

[0035] Figure 2 It is a structural diagram of a real-time synchronization device for a toll collection terminal in a highway toll collection system according to an embodiment of the present invention. Detailed implementation manners

[0036] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the relevant invention and are not intended to limit the invention. Additionally, it should be noted that for the sake of description, only parts related to the relevant invention are shown in the drawings.

[0037] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0038] Figure 1 A real-time synchronization method for a toll collection terminal in a highway toll collection system of the present invention is shown. The highway lane toll collection system includes a server and N toll collection terminals, where N is greater than or equal to 2. The method includes:

[0039] Construction step S101: Construct a SignalR hub on the server and construct a multi-terminal interface service class MTCUIService. The MTCUIService is used to place the code for the server to push interface data to the N toll collection terminals, and the MTCUIService maintains the interface data of the lane toll collection software on the N toll collection terminals.

[0040] Detection step S102: When it is detected that the interface data is updated, obtain the IDs of the N toll collection terminals, and construct a HubService instance corresponding to each toll collection terminal based on the IDs of the N toll collection terminals based on the SignalR hub. The HubService instance of each toll collection terminal is used to communicate with the corresponding toll collection terminal.

[0041] Synchronization step S103: Build a Context object in the SignalR hub. Based on the Context object, enable each toll collection terminal to establish a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance. The updated interface data is transmitted to the corresponding toll collection terminal through the corresponding communication pipeline, so that the interfaces on the N toll collection terminals are synchronized and consistent.

[0042] SignalR in the present invention is a library provided for ASP.NET developers, which can simplify the process for developers to add real-time Web functionality to applications. The real-time Web functionality refers to a function where server code can immediately push content to connected clients when they become available, rather than having the server wait for clients to request new data.

[0043] In the present invention, to solve the defects of the traditional C / S high-speed lane toll software system in the prior art, where the business processing and UI code are mutually coupled, it is difficult to modify, and faults are likely to occur. First, a SignalR hub is constructed on the server side, and a multi-terminal interface service class MTCUIService is constructed. The MTCUIService is used to place the code for the server to push interface data to the N toll terminals, and the MTCUIService maintains the interface data of the lane toll software on the N toll terminals. When it is detected that the interface data is updated, based on the IDs of the N toll terminals, HubService instances corresponding to each toll terminal are constructed based on the SignalR hub. The HubService instance of each toll terminal is used to communicate with the corresponding toll terminal. Then, based on the Context object, each toll terminal establishes a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance. The updated interface data is transmitted to the corresponding toll terminal through the corresponding communication pipeline, so that the interfaces on the N toll terminals are synchronized and consistent. Thus, through the multi-terminal interface service class MTCUIService and HubService instances, the program code on the server side and the toll terminals is decoupled, enabling one server to support multiple toll terminals. When the interface on one toll terminal changes, the display interfaces on other terminals are synchronously updated, making the interface displays of the toll terminals consistent. That is, one backend transaction server corresponds to N front-end lane toll software clients. When each front-end lane toll software client conducts human-computer interaction, it will interact with the business logic of the backend transaction server. At the same time, the backend transaction server will notify each front-end lane toll software client of the changes resulting from the logical interaction, keeping the interfaces of each front-end lane toll software client strongly consistent, providing an important basis for the later cloud-based toll software, and having a fast update speed. This is an important inventive concept of the present invention.

[0044] In a further embodiment, the method for detecting that the interface data is updated is as follows: The MTCUIService on the server side detects whether the interface data has changed due to business logic; or, the user sends an update detection instruction to the server from any toll terminal to detect whether the interface data is updated. That is, in the present invention, the change of the interface data can be initiated by the toll terminal for detection, or detected by the server through the MTCUIService, improving the performance of update detection. This is another important inventive point of the present invention.

[0045] In a further embodiment, the operation that causes the interface data to change due to the business logic is as follows: when a user interacts with the lane toll software on at least one of the N toll collection terminals, data interaction is performed with the business logic on the server, thereby causing the interface data to be updated. That is, when the user interacts with the interface through the display on the toll collection terminal, for example, when performing operations such as modifying or adjusting the current interface, data interaction will be performed with the business logic on the server, thereby causing the interface data to be updated.

[0046] In a further embodiment, the communication pipeline transmits the updated interface data to the corresponding toll collection terminal through the streaming transmission of MessagePack to synchronize the lane toll software on each toll collection terminal. That is, in the present invention, after the business logic of the back-end transaction service changes, the streaming transmission of MessagePack will be used to synchronize each front-end lane toll software client, reducing the waiting time and making the human-computer interaction more fluent. This is an important inventive point of the present invention.

[0047] In a further embodiment, at least one of the N toll collection terminals has a different type from the other terminals. The present invention can use client SDKs of JavaScript,.NET, C#, F#, Visual Basic, and Java to connect to the SignalR hub and start receiving real-time messages on almost any platform (including Web, mobile, and desktop). SignalR will use WebSockets when available and, when not available, can use other technologies such as long polling, while the application code remains unchanged, having cross-platform capabilities. This improves the cross-platform capabilities of the system, which is another important inventive point of the present invention.

[0048] In a further embodiment, a proxy layer is provided between the N toll collection terminals and the server, and the N toll collection terminals and the server call each other's functions through the proxy layer. Although the business codes of the front and back ends (the front end is the toll collection terminal and the back end is the server) are in two different services, when interacting with each other, their methods (functions) can be directly called through the proxy mode without the need to separately call an interface, reducing the amount of code, but at the same time achieving the simplicity of calling methods in a monolithic C / S architecture. This is another important inventive point of the present invention.

[0049] In a further embodiment, when a user interacts with the lane toll software on M of the N toll collection terminals simultaneously, data interaction is performed with the business logic on the server, and the method for determining the updated interface data is as follows:

[0050] Calculate the influence degree Ci of the human-computer interaction of the lane toll software service on each toll terminal on the business logic, and select the interface data resulting from the change in the business logic corresponding to the largest Ci value as the updated interface data, where the calculation method of Ci is:

[0051]

[0052] where w1 and w2 are weight values, v i is the amount of change in the interface data caused by the human-computer interaction, and l i is the number of business logics called by the human-computer interaction on one terminal, N≥M≥2, M≥i≥1.

[0053] The present invention solves the technical problem of interface update when multiple users operate simultaneously, that is, which user's operation is selected as the updated interface. In the present invention, the influence degree Ci of the human-computer interaction of the lane toll software service on each toll terminal on the business logic is calculated, and the interface data resulting from the change in the business logic corresponding to the largest Ci value is selected as the updated interface data. The influence degree Ci is calculated based on the amount of change in the interface data caused by the human-computer interaction and the number of business logics called by the human-computer interaction, and a specific calculation formula is proposed, solving the update conflict problem, which is one of the important inventive concepts of the present invention.

[0054] Figure 2 Shows a real-time synchronization device for a toll terminal in a highway toll system of the present invention. The highway lane toll system includes a server and N toll terminals, N is greater than or equal to 2. The device includes:

[0055] A construction unit 201 constructs a SignalR hub on the server and constructs a multi-terminal interface service class MTCUIService. The MTCUIService is used to place the code for the server to push interface data to the N toll terminals, and the MTCUIService maintains the interface data of the lane toll software on the N toll terminals;

[0056] A detection unit 202, when detecting that the interface data is updated, obtains the IDs of the N toll terminals, and constructs a HubService instance corresponding to each toll terminal based on the IDs of the N toll terminals based on the SignalR hub. The HubService instance of each toll terminal is used to communicate with the corresponding toll terminal;

[0057] The synchronization unit 203 constructs a Context object in the SignalR hub, and based on the Context object, enables each toll collection terminal to establish a corresponding communication pipeline with the MTCUIService through a corresponding HubService instance. The updated interface data is transmitted to the corresponding toll collection terminal through the corresponding communication pipeline, so that the interfaces on the N toll collection terminals are synchronized and consistent.

[0058] SignalR in the present invention is a library provided for ASP.NET developers, which can simplify the process for developers to add real-time Web capabilities to applications. The real-time Web capabilities refer to such a function that when the connected client becomes available, the server code can immediately push content to it, rather than letting the server wait for the client to request new data.

[0059] In the present invention, to solve the defects in the prior art that the business processing and UI code of the traditional C / S high-speed lane toll software system are coupled with each other, it is difficult to modify, and faults are likely to occur, a SignalR hub is first built on the server side, and a multi-terminal interface service class MTCUIService is built. The MTCUIService is used to place the code for the server to push interface data to the N toll terminals, and the MTCUIService maintains the interface data of the lane toll software on the N toll terminals. When it is detected that the interface data is updated, based on the IDs of the N toll terminals, HubService instances corresponding to each toll terminal are built based on the SignalR hub. The HubService instance of each toll terminal is used to communicate with the corresponding toll terminal. Then, based on the Context object, each toll terminal establishes a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance. The updated interface data is transmitted to the corresponding toll terminal through the corresponding communication pipeline, so that the interfaces on the N toll terminals are synchronized and consistent. Thus, through the multi-terminal interface service class MTCUIService and HubService instances, the program codes on the server side and the toll terminals are decoupled, enabling one server to support multiple toll terminals. When the interface on one toll terminal changes, the display interfaces on other terminals are synchronously updated, making the interface displays of the toll terminals consistent, that is, one back-end transaction server corresponds to N front-end lane toll software clients. When each front-end lane toll software client conducts human-computer interaction, it will interact with the business logic of the back-end transaction server. At the same time, the back-end transaction server will notify each front-end lane toll software client of the changes generated by the logical interaction, so that the interfaces of each front-end lane toll software client are kept strongly consistent, providing an important basis for the later cloud-based toll software, and with a fast update speed, which is an important inventive concept of the present invention.

[0060] In a further embodiment, the method for detecting that the interface data is updated is as follows: The MTCUIService on the server side is used to detect whether the interface data has changed due to business logic; or, a user sends an update detection instruction to the server from any toll terminal to detect whether the interface data is updated. That is, in the present invention, the change of the interface data can be initiated by the toll terminal for detection, or detected by the server through the MTCUIService, improving the performance of update detection, which is another important inventive point of the present invention.

[0061] In a further embodiment, the operation that causes the interface data to change due to the business logic is as follows: when the user interacts with the lane toll software on at least one of the N toll collection terminals, data interaction is performed with the business logic on the server, thereby causing the interface data to be updated. That is, when the user interacts with the interface through the display on the toll collection terminal, for example, when performing operations such as modifying or adjusting the current interface, data interaction will be performed with the business logic on the server, thereby causing the interface data to be updated.

[0062] In a further embodiment, the communication pipeline transmits the updated interface data to the corresponding toll collection terminal through the streaming transmission of MessagePack to synchronize the lane toll software on each toll collection terminal. That is, in the present invention, after the business logic of the backend transaction service changes, it will be synchronized to each front-end lane toll software client through the streaming transmission of MessagePack, reducing the waiting time and making the human-computer interaction more fluent. This is an important inventive point of the present invention.

[0063] In a further embodiment, at least one of the N toll collection terminals has a different type from other terminals. The present invention can use client SDKs of JavaScript,.NET, C#, F#, Visual Basic, and Java to connect to the SignalR hub and start receiving real-time messages on almost any platform (including Web, mobile, and desktop). SignalR will use WebSockets when available and other technologies such as long polling when not available, while the application code remains unchanged, having cross-platform capabilities. This improves the cross-platform capabilities of the system, which is another important inventive point of the present invention.

[0064] In a further embodiment, a proxy layer is provided between the N toll collection terminals and the server, and the N toll collection terminals and the server call each other's functions through the proxy layer. Although the business codes of the front end (the front end is the toll collection terminal) and the back end (the back end is the server) are in two different services, when interacting with each other, their methods (functions) can be directly called through the proxy mode without the need to separately call an interface, reducing the amount of code, but at the same time achieving the simplicity of calling methods in a monolithic C / S architecture. This is another important inventive point of the present invention.

[0065] In a further embodiment, when the user simultaneously interacts with the lane toll software on M of the N toll collection terminals, data interaction is performed with the business logic on the server, and the method for determining the updated interface data is as follows:

[0066] Calculate the influence degree Ci of the human-computer interaction of the lane toll software service on the service logic on each toll terminal, and select the interface data resulting from the change in the service logic corresponding to the largest Ci value as the updated interface data. The calculation method of Ci is as follows:

[0067]

[0068] where w1 and w2 are weight values, v i is the amount of change in the interface data caused by the human-computer interaction, and l i is the number of service logics invoked by the human-computer interaction on one terminal, N≥M≥2, M≥i≥1.

[0069] The present invention solves the technical problem of interface update when multiple users operate simultaneously, that is, which user's operation is selected as the updated interface. In the present invention, the influence degree Ci of the human-computer interaction of the lane toll software service on the service logic on each toll terminal is calculated, and the interface data resulting from the change in the service logic corresponding to the largest Ci value is selected as the updated interface data. The influence degree Ci is calculated based on the amount of change in the interface data caused by the human-computer interaction and the number of service logics invoked by the human-computer interaction, and a specific calculation formula is proposed, which solves the update conflict problem. This is one of the important inventive concepts of the present invention.

[0070] In an embodiment of the present invention, a computer storage medium is proposed. A computer program is stored on the computer storage medium, and when the computer program on the computer storage medium is executed by a processor, the above method is implemented. The computer storage medium can be a hard disk, DVD, CD, flash memory, etc.

[0071] For the convenience of description, the above device is described by dividing it into various units according to functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0072] From the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the device described in each embodiment or some parts of the embodiments of the present application.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate rather than limit the technical solutions of the present invention. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that the present invention can still be modified or equivalently replaced, and any modification or partial replacement without departing from the spirit and scope of the present invention should be covered by the scope of the claims of the present invention.

Claims

1. A real-time synchronization method for a toll terminal in a highway toll collection system, characterized in that, The highway lane toll collection system includes a server and N toll collection terminals, where N is greater than or equal to 2. The method includes: A construction step of constructing a SignalR hub on the server and constructing a multi-terminal interface service class MTCUIService. The MTCUIService is used to place the code for the server to push interface data to the N toll collection terminals, and the MTCUIService maintains the interface data of the lane toll collection software on the N toll collection terminals; A detection step of, when detecting that the interface data is updated, obtaining the IDs of the N toll collection terminals, and constructing a HubService instance corresponding to each toll collection terminal based on the SignalR hub based on the IDs of the N toll collection terminals. The HubService instance of each toll collection terminal is used to communicate with the corresponding toll collection terminal; A synchronization step of constructing a Context object in the SignalR hub, and based on the Context object, enabling each toll collection terminal to establish a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance. The updated interface data is transmitted to the corresponding toll collection terminal through the corresponding communication pipeline, so that the interfaces on the N toll collection terminals are synchronized and consistent; Among them, the method of detecting that the interface data is updated is: detecting through the MTCUIService on the server whether the interface data is changed due to business logic; or, a user sends an update detection instruction to the server on any toll collection terminal to detect whether the interface data is updated; Among them, the operation that causes the interface data to change due to business logic is: when a user performs human-computer interaction with the lane toll collection software on at least one of the N toll collection terminals, data interaction is performed with the business logic on the server, thereby causing the interface data to be updated.

2. The method according to claim 1, wherein The communication pipeline transmits the updated interface data to the corresponding toll collection terminal through the streaming transmission of MessagePack to synchronize the lane toll collection software on each toll collection terminal.

3. The method according to claim 2, wherein At least one of the N toll collection terminals has a different type from other terminals.

4. The method according to claim 3, characterized in that, A proxy layer is provided between the N toll collection terminals and the server, and the N toll collection terminals and the server call each other's functions through the proxy layer.

5. A real-time synchronization device for a toll terminal in a highway toll collection system, characterized in that, The highway lane toll collection system includes a server and N toll collection terminals, where N is greater than or equal to 2. The device includes: A construction unit that constructs a SignalR hub on the server and constructs a multi-terminal interface service class MTCUIService. The MTCUIService is used to place the code for the server to push interface data to the N toll collection terminals, and the MTCUIService maintains the interface data of the lane toll collection software on the N toll collection terminals; A detection unit, when detecting that the interface data is updated, obtains the IDs of the N toll collection terminals, and constructs a HubService instance corresponding to each toll collection terminal based on the SignalR hub according to the IDs of the N toll collection terminals. The HubService instance of each toll collection terminal is used to communicate with the corresponding toll collection terminal; A synchronization unit constructs a Context object in the SignalR hub, and based on the Context object, enables each toll collection terminal to establish a corresponding communication pipeline with the MTCUIService through the corresponding HubService instance. The updated interface data is transmitted to the corresponding toll collection terminal through the corresponding communication pipeline, so that the interfaces on the N toll collection terminals are synchronized and consistent; Among them, the method of detecting that the interface data is updated is as follows: detecting through the MTCUIService on the server whether the interface data is changed due to business logic; or, a user sends an update detection instruction to the server on any toll collection terminal to detect whether the interface data is updated; Among them, the operation that causes the interface data to change due to business logic is: when a user performs human-computer interaction with the lane toll collection software on at least one of the N toll collection terminals, data interaction is performed with the business logic on the server, thereby causing the interface data to be updated.

6. A computer storage medium, on which a computer program is stored. When the computer program on the computer storage medium is executed by a processor, the method according to any one of claims 1-4 is implemented.

Citation Information

Patent Citations

  • Expressway networking toll collection system

    CN113284267A

  • Method and system for controlling robot through far-end HTTP webpage

    CN114265970A