Business status update methods and related equipment
By working collaboratively between the status management module and the communication module of the cloud server, the problem of server resource consumption caused by frequent queries from business terminals was solved, and real-time updates of business status information were achieved.
Patent Information
- Application Number
- CN202211229831.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-08
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-10-08
AI Technical Summary
In existing technologies, business terminals frequently query the server for business status information, which increases server resource and performance consumption, and the obtained status information may not be real-time.
The system receives updated target business status information from the business service layer via the cloud server's status management module, detects the registration status of the status update trigger module, and, if registered, assembles and packages the information based on the target communication protocol before pushing it to the business terminal.
This reduces server-side resource and performance consumption and enables real-time updates of business status information.
Smart Images

Figure CN117896375B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a service status update method and related equipment. Background Technology
[0002] With the development of computer technology, many business processes are now handled online. The business status information of business terminals needs to be updated frequently; this information can include service deployment status during the service deployment process.
[0003] In current technologies, the common practice is for the front-end page of a general business terminal to periodically poll the back-end service to continuously update business status information. This method of updating business status generates a large number of meaningless requests, and the frequent queries from the business terminal to the server increase the server's resource and performance consumption. In addition, the business status information obtained may not be real-time. Summary of the Invention
[0004] This application provides a service status update method and related equipment. The related equipment may include a service status update device, an electronic device, and a computer-readable storage medium. This method can avoid frequent queries from the service terminal to the server for updates, reduce the resource and performance consumption of the server, and enable real-time updates of service status information.
[0005] This application provides a service status update method applicable to cloud servers. The cloud server includes a service service layer, a service status management layer, and a communication service layer. The service status management layer includes a status management module and a status update triggering module. The method includes:
[0006] When the business status information of the business service layer is updated, the updated target business status information sent by the business service layer is received through the status management module.
[0007] The registration status of the status update triggering module is detected;
[0008] When the status update triggering module is detected to be in a registered state, the target service status information is sent to the status update triggering module;
[0009] The state update triggering module assembles and packages the target service state information based on the target communication protocol and sends a state update instruction to the communication module of the communication service layer. The state update instruction includes the assembled and packaged target service state information.
[0010] When the communication module receives the status update instruction, it is triggered to send the assembled and packaged target service status information to the service terminal based on the target communication protocol.
[0011] Accordingly, this application provides a business status update device suitable for cloud servers. The cloud server includes a business service layer, a service status management layer, and a communication service layer. The service status management layer includes a status management module and a status update triggering module. The device includes:
[0012] The receiving unit is used to receive the updated target service status information sent by the service service layer through the status management module when the service status information of the service service layer is updated.
[0013] The detection unit is used to detect the registration status of the status update triggering module;
[0014] The first sending unit is used to send the target service status information to the status update triggering module when the status update triggering module is detected to be in a registered state.
[0015] An assembly unit is used to assemble and package the target service status information based on the target communication protocol through the status update triggering module, and send a status update instruction to the communication module of the communication service layer. The status update instruction includes the assembled and packaged target service status information.
[0016] The second sending unit is used to trigger the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol when the communication module receives the status update instruction.
[0017] Optionally, in some embodiments of this application, the service status update device may further include a registration unit, as follows:
[0018] The registration unit is used to receive registration information sent by the status update triggering module through the status management module; and based on the registration information, update the registration status of the status update triggering module to the registered status.
[0019] Optionally, in some embodiments of this application, the cloud server further includes a storage layer, the storage module of which stores the service status information updated by the service layer; the service status update device may further include a service status acquisition unit, as follows:
[0020] The service status acquisition unit is configured to, based on the communication connection established between the communication module and the service terminal under the target communication protocol, receive a request for acquiring service status information sent by the service terminal through the communication module; based on the acquisition request, call the status update triggering module to acquire service status information from the storage module; and send the service status information to the service terminal through the communication module based on the target communication protocol.
[0021] Optionally, in some embodiments of this application, the second sending unit may include a routing address acquisition subunit, a judgment subunit, and a first sending subunit, as follows:
[0022] The routing address acquisition subunit is used to acquire the routing address information of the currently accessed page of the business terminal through the communication module when the communication module receives the status update instruction.
[0023] The judgment subunit is used to determine, based on the routing address information, whether the service terminal needs to display service status information;
[0024] The first sending subunit is used to trigger the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol when the service terminal needs to display service status information.
[0025] Optionally, in some embodiments of this application, the status update instruction includes reference service status information that has been historically updated by the service service layer; the second sending unit may include a comparison subunit and a second sending subunit, as follows:
[0026] The comparison subunit is used to trigger the communication module to compare the reference service status information with the service status information currently displayed on the service terminal when the communication module receives the status update instruction.
[0027] The second sending subunit is used to send the assembled and packaged target service status information to the service terminal based on the target communication protocol according to the comparison result.
[0028] Optionally, in some embodiments of this application, the comparison subunit may be specifically used to trigger the communication module to perform a hash operation on the reference service status information to obtain a first hash value; perform a hash operation on the service status information currently displayed by the service terminal to obtain a second hash value; and compare the first hash value and the second hash value.
[0029] Optionally, in some embodiments of this application, the second sending subunit may be specifically used to determine, based on the reference service status information, from at least one sub-status information of the assembled and packaged target service status information when the reference service status information is consistent with the service status information currently displayed by the service terminal; and to send the target sub-status information to the service terminal based on the target communication protocol when the reference service status information is inconsistent with the service status information currently displayed by the service terminal.
[0030] Optionally, in some embodiments of this application, the cloud server further includes a storage layer, the storage module of which stores the service status information updated by the service layer; the service status update device may further include a first reconnection unit, as follows:
[0031] The first reconnection unit is configured to, when the communication connection with the service terminal is disconnected and a new communication connection is established, receive a request for obtaining service status information sent by the service terminal through the communication module; based on the request, call the status update triggering module to obtain service status information whose update time meets a preset time condition from the storage module; and send the service status information whose update time meets the preset time condition to the service terminal through the communication module based on the target communication protocol.
[0032] Optionally, in some embodiments of this application, the service status update device may further include a second connection reconstruction unit, as follows:
[0033] The second reconnection unit is configured to, when disconnecting from the service terminal and re-establishing the communication connection, and detecting that the status management module is currently sending updated service status information to the status update triggering module, trigger the status update triggering module to assemble and package the updated service status information based on the target communication protocol; send a target status update instruction to the communication module, the target status update instruction including the assembled and packaged service status information and historically updated reference service status information; when the communication module receives the target status update instruction, trigger the communication module to compare the reference service status information with the service status information currently displayed by the service terminal; and, based on the comparison result, send the assembled and packaged service status information to the service terminal through the communication module based on the target communication protocol.
[0034] Optionally, in some embodiments of this application, the communication service layer includes at least two distributed communication modules, each communication module communicating with at least one service terminal;
[0035] The assembly unit can be specifically used to assemble and package the target service status information based on the target communication protocol through the status update triggering module, and send status update instructions to each communication module of the communication service layer respectively.
[0036] The second sending unit can be specifically used to trigger the communication module to send the assembled and packaged target service status information to each service terminal corresponding to the communication module based on the target communication protocol when the communication module receives the status update instruction.
[0037] Optionally, in some embodiments of this application, the target business status information includes content status data of the client page. Specifically, the receiving unit can be used to receive a page update instruction containing the content status data sent by the business service layer through the status management module when the page content of the client page in the business service layer is updated. The content status data includes the updated page content data of the client page.
[0038] The first sending unit can be specifically used to send a page update triggering instruction to the status update triggering module when the status update triggering module is detected to be in a registered state. The page update triggering instruction includes the content status data.
[0039] Specifically, the assembly unit can be used to respond to the page update triggering instruction through the state update triggering module, assemble the updated page content data based on the target communication protocol to obtain assembled page content data; and perform packaging and compression processing on the assembled page content data to obtain packaged and compressed page content data.
[0040] Optionally, in some embodiments of this application, the status update instruction includes reference business status information that has been updated historically by the business service layer; the reference business status information includes historical content status data of the client page, and the historical content status data includes historical page content data of the client page;
[0041] Specifically, the second sending unit can be used to trigger the communication module to compare the historical page content data with the page content data currently displayed by the business terminal when the communication module receives the status update instruction; when the historical page content data is inconsistent with the page content data currently displayed by the business terminal, the unit can send the full amount of the packaged and compressed page content data to the business terminal based on the target communication protocol.
[0042] An electronic device provided in this application includes a processor and a memory. The memory stores multiple instructions, and the processor loads the instructions to execute the steps in the service status update method provided in this application.
[0043] This application also provides a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps in the business status update method provided in this application.
[0044] Furthermore, embodiments of this application also provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the business status update method provided in embodiments of this application.
[0045] This application provides a service status update method and related equipment. When the service status information of the service layer is updated, the status management module receives the updated target service status information sent by the service layer; the registration status of the status update triggering module is detected; when the status update triggering module is detected as registered, the target service status information is sent to the status update triggering module; the status update triggering module assembles and packages the target service status information based on a target communication protocol and sends a status update instruction to the communication module of the communication service layer, the status update instruction including the assembled and packaged target service status information; when the communication module receives the status update instruction, it is triggered to send the assembled and packaged target service status information to the service terminal based on the target communication protocol. This application can push updated service status information to the service terminal using the target communication protocol, thus avoiding frequent querying of the server by the service terminal, reducing server resource and performance consumption, and enabling real-time updates of service status information. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1a This is a schematic diagram of a scenario for the business status update method provided in an embodiment of this application;
[0048] Figure 1b This is a flowchart of the service status update method provided in the embodiments of this application;
[0049] Figure 1c This is a product schematic diagram of the business status update method provided in the embodiments of this application;
[0050] Figure 1d This is a schematic diagram of a page illustrating the business status update method provided in an embodiment of this application;
[0051] Figure 1e This is a schematic diagram of the business status update method provided in the embodiments of this application;
[0052] Figure 1f This is another flowchart of the business status update method provided in the embodiments of this application;
[0053] Figure 1gThis is another flowchart of the business status update method provided in the embodiments of this application;
[0054] Figure 1h This is another flowchart of the business status update method provided in the embodiments of this application;
[0055] Figure 1i This is another flowchart of the business status update method provided in the embodiments of this application;
[0056] Figure 1j This is another flowchart of the business status update method provided in the embodiments of this application;
[0057] Figure 1k This is another flowchart of the business status update method provided in the embodiments of this application;
[0058] Figure 2 This is another flowchart of the business status update method provided in the embodiments of this application;
[0059] Figure 3 This is a schematic diagram of the structure of the service status update device provided in the embodiments of this application;
[0060] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0062] This application provides a service status update method and related equipment. The related equipment may include a service status update device, an electronic device, and a computer-readable storage medium. Specifically, the service status update device may be integrated into an electronic device, which may be a terminal or a server, etc.
[0063] It is understood that the service status update method in this embodiment can be executed jointly by the terminal and the server. The above examples should not be construed as limiting this application.
[0064] like Figure 1a As shown, the example of a service status update method jointly executed by a terminal and a server is illustrated. The service status update system provided in this application includes a terminal 10 and a server 11, etc.; the terminal 10 and the server 11 are connected via a network, such as a wired or wireless network, etc., wherein the service status update device can be integrated into the server.
[0065] Specifically, server 11 can be a cloud server, which includes a business service layer, a service status management layer, and a communication service layer. The service status management layer includes a status management module and a status update triggering module.
[0066] Server 11 can be used to: receive updated target business status information sent by the business service layer through the status management module when the business status information of the business service layer is updated; detect the registration status of the status update triggering module; when the status update triggering module is detected to be registered, send the target business status information to the status update triggering module; assemble and package the target business status information based on the target communication protocol through the status update triggering module, and send a status update instruction to the communication module of the communication service layer, the status update instruction including the assembled and packaged target business status information; when the communication module receives the status update instruction, trigger the communication module to send the assembled and packaged target business status information to the terminal 10 based on the target communication protocol. Server 11 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The business status update method or apparatus disclosed in this application includes a blockchain composed of multiple servers, where the servers are nodes on the blockchain.
[0067] Terminal 10 can be used to: receive the assembled and packaged target service status information sent by the communication module based on the target communication protocol, and update and display the assembled and packaged target service status information on the front-end page. Terminal 10 may include mobile phones, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, tablet computers, laptops, desktop computers, smartwatches, or personal computers (PCs), etc. A client can also be set on terminal 10, which can be an application client or a browser client, etc.
[0068] The business status update method provided in this application relates to private clouds in the field of cloud technology.
[0069] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Specifically, cloud technology is a collective term for network technology, information technology, integration technology, management platform technology, and application technology applied based on the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.
[0070] Private cloud refers to the creation of cloud infrastructure and hardware / software resources within a firewall, allowing various departments within an organization or enterprise to share resources within a data center. Besides hardware resources, creating a private cloud typically involves cloud equipment (IaaS, Infrastructure as a Service) software. Private cloud computing also comprises three layers: cloud hardware, cloud platform, and cloud services. The difference is that cloud hardware consists of the user's own personal computer or server, rather than the cloud computing vendor's data center. Cloud computing vendors build data centers to provide public cloud services to millions of users, thus requiring hundreds of thousands or even millions of servers. For individuals, private cloud computing serves only family and friends; for enterprises, it serves only their own employees, customers, and suppliers. Therefore, the personal computers or servers of individuals or enterprises are sufficient to provide cloud services.
[0071] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.
[0072] This embodiment will be described from the perspective of a business status update device, which can be integrated into an electronic device, such as a server.
[0073] This embodiment can be applied to various scenarios such as cloud technology, artificial intelligence, smart transportation, and assisted driving.
[0074] like Figure 1b As shown, the specific process of this business status update method can be as follows:
[0075] 101. When the business status information of the business service layer is updated, the updated target business status information sent by the business service layer is received through the status management module.
[0076] In this embodiment, the service status update method is applicable to a cloud server. The cloud server includes a service service layer, a service status management layer, and a communication service layer. The service status management layer includes a status management module and a status update triggering module.
[0077] The business service layer can be used to deploy services for various businesses. The business deployment process can include at least one step. Specifically, at the beginning and end of each step in the deployment process, the business service layer will call the status management module (i.e., the service status update center) to synchronize the current status of the business service, that is, synchronize the updated target business status information to the status management module.
[0078] The service status management layer is the underlying service corresponding to the business service. It manages the updates of business status information. The service status management layer can include a status management module and a status update triggering module. The status management module is specifically the service status update center, which is mainly responsible for collecting service update status data, storing the updated business status information, receiving registrations from triggers (specifically the status update triggering module), and notifying registered triggers. The status update triggering module is specifically the service status update trigger, which is mainly responsible for registering itself with the service status update center, receiving service update data, querying data from the database (DB), caching data, and invoking WebSocket push capabilities, etc.
[0079] The communication service layer specifically provides the server-side capabilities under the target communication protocol. In some embodiments, the communication service layer can provide HTTP services and WebSocket communication capabilities. The WebSocket communication capabilities can be implemented custom-made or implemented using mature libraries such as Socket.IO.
[0080] HTTP (Hypertext Transfer Protocol) is a simple request-response protocol. Socket.IO is a WebSocket library that includes JavaScript for the client and Node.js for the server, aiming to build real-time applications that can be used on different browsers and mobile devices. Node.js is an open-source and cross-platform JavaScript runtime environment. JS, or JavaScript, is a lightweight, interpreted or just-in-time (JIT) programming language with a function-first approach.
[0081] In this embodiment, the business status information refers to the background service data of the business, including the status of the business service. Specifically, it can be the detection service status data or the service deployment status during the service deployment process. For example, the service deployment status can be "deployment started," "deployment in progress," or "deployment completed." Specifically, the service deployment status can be presented as a deployment progress bar. The target business status information is specifically the currently updated business status information.
[0082] In specific scenarios, the business status information of the business terminal needs to be updated. This embodiment can utilize the target communication protocol in a private cloud scenario to obtain or push backend service data to the web (World Wide Web) page or other front-end pages of the business terminal for display in real time. For example, refer to... Figure 1c The front-end page displays the service status in real time. The example shows the deployment status: Tcenter (basic platform) service deployment failed, OSP (operation and maintenance platform) is being deployed, and other services BSP (operation platform) and BMPPro (operation platform) are waiting to be deployed.
[0083] In current technologies, the common practice is for the front-end page of a general business terminal to periodically poll the back-end service to continuously update business status information. Specifically, the front-end page uses Ajax or fetch technologies to retrieve service status data from the back-end. The back-end service retrieves service status data by checking the status of other services or from a database storing service status data (such as MySQL or Redis), and then returns the data to the front-end page. The front-end page then displays this service status data. A scheduled task is set to poll this process every minute (or at other intervals, depending on the real-time requirements and service pressure) to continuously obtain new service status information and display it on the front-end page. This method of updating business status generates a large number of meaningless requests, and frequent queries from the business terminal to the server increase server resource and performance consumption, as well as network bandwidth consumption. Furthermore, the obtained business status information may not be real-time. Additionally, frequent polling queries from the front-end page can cause other one-time data retrieval requests to be overwhelmed by the polling query requests, which is detrimental to page function development and debugging.
[0084] In the business status update method provided in this application, the business terminal can communicate with the backend server via WebSocket technology. After the connection is established, when the business status information of the business service layer changes, the backend can actively push the updated business status information to the business terminal. The front-end page of the business terminal can display the service status change information with the highest timeliness, such as... Figure 1d As shown.
[0085] Optionally, in this embodiment, the cloud server further includes a storage layer, and the storage module of the storage layer stores the business status information updated by the business service layer;
[0086] This business status update method may also include:
[0087] Based on the communication connection established between the communication module and the service terminal under the target communication protocol, the communication module receives the service terminal's request for obtaining service status information.
[0088] Based on the acquisition request, the status update triggering module is invoked to obtain business status information from the storage module;
[0089] The communication module sends the service status information to the service terminal based on the target communication protocol.
[0090] The target communication protocol can be a protocol that enables full-duplex communication between the business terminal and the server. Full-duplex communication means that data can be transmitted simultaneously in both directions, which is equivalent to a combination of two simplex communication methods. For example, the target communication protocol could be the WebSocket protocol.
[0091] The storage layer is primarily responsible for persistently storing updated state information for storage services. It can be a database such as MySQL or MongoDB, but for improved read efficiency, storage solutions like Redis can also be considered. Specifically, the storage module stores the latest updated business state information from the business service layer.
[0092] Redis is a high-performance key-value database and an in-memory storage system. It is often referred to as a data structure server and supports a wide range of value types, including strings, hashes, lists, sets, and sorted sets.
[0093] Specifically, the service terminal can initiate a communication connection with the cloud server under the target communication protocol, thereby establishing a communication connection between the service terminal and the communication module in the cloud server's communication service layer under the target communication protocol. After establishing the communication connection, the service terminal then sends a request to the communication module to obtain service status information.
[0094] Specifically, after the status update triggering module obtains the business status information from the storage module, it can assemble and package the business status information and then send the assembled and packaged business status information to the communication module. The communication module sends the assembled and packaged business status information to the business terminal based on the target communication protocol.
[0095] 102. Detect the registration status of the status update triggering module.
[0096] The registration status of the status update triggering module can include a registered status and an unregistered status. This embodiment can detect whether the status update triggering module is in a registered status; if so, the status management module can send the target service status information to the status update triggering module.
[0097] 103. When the status update triggering module is detected to be in a registered state, the target service status information is sent to the status update triggering module.
[0098] Optionally, before the step "when the status update triggering module is detected to be in a registered state, send the target service status information to the status update triggering module", the service status update method may further include:
[0099] The status management module receives the registration information sent by the status update triggering module.
[0100] Based on the registration information, the registration status of the status update triggering module is updated to "registered".
[0101] The registration information may include the module identifier of the status update triggering module. Based on this registration information, the status management module can authenticate the status update triggering module and update its status from unregistered to registered.
[0102] 104. The state update triggering module assembles and packages the target service state information based on the target communication protocol and sends a state update instruction to the communication module of the communication service layer. The state update instruction includes the assembled and packaged target service state information.
[0103] The target communication protocol is the protocol that enables full-duplex communication between the business terminal and the server. For example, the target communication protocol could be the WebSocket protocol.
[0104] WebSocket is a protocol that enables full-duplex communication over a single Transmission Control Protocol (TCP) connection. WebSocket simplifies data exchange between clients and servers, allowing the server to proactively push data to the client. In the WebSocket API (Application Programming Interface), the client and server only need to complete a single handshake to establish a persistent connection and perform bidirectional data transmission.
[0105] Among them, the status update instruction is mainly used to instruct the communication module to send the updated target service status information to the service terminal, so as to update the service status information displayed in the service terminal.
[0106] 105. When the communication module receives the status update instruction, it triggers the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol.
[0107] The business terminal can be a web browser, a mobile application (App), or a desktop client, etc. This embodiment does not limit this.
[0108] In one specific embodiment, such as Figure 1e The diagram shown is an architecture diagram of the business status update method of this application, and the details are as follows:
[0109] This business status update method is applicable to cloud servers. The cloud server includes a business service layer, a storage layer, a service status management layer, and a communication service layer. The service status management layer includes a service status update center (i.e., the status management module in the above embodiment) and a service status update trigger (hereinafter referred to as the trigger, i.e., the status update triggering module in the above embodiment). The business service layer can deploy various business services, such as Tcenter (basic platform) service, BSP (operation platform) service, CSP (Cloud Storage on Private) service, COS (storage platform) service, etc. The communication service layer can provide HTTP (Hypertext Transfer Protocol) service and WebSocket communication capabilities. The business terminal can be a client, specifically a browser client or an application client; this embodiment does not impose any restrictions on this.
[0110] The specific interaction logic between the cloud server and the business terminal is explained below:
[0111] 1. The trigger registers with the service status update center. Specifically, the trigger sends registration information to the service status update center, which then registers the trigger based on this information and updates its registration status to "registered".
[0112] 2. The client initiates a communication connection under the target communication protocol, such as initiating a WebSocket connection;
[0113] 3. The backend service's communication service layer establishes a communication connection with the client under the target communication protocol, such as a WebSocket connection;
[0114] 4. After establishing a communication connection under the target communication protocol, the client sends a request to the communication service layer to obtain service status data (i.e., business status information in the above embodiment) based on the target communication protocol. This request is specifically a WebSocket message.
[0115] 5. When the communication service layer receives the WebSocket message, the communication service layer invokes the trigger;
[0116] 6. The trigger retrieves service status data from the database in the storage layer, assembles and packages the service status data, caches it, and returns the assembled and packaged service status data to the WebSocket service in the communication service layer.
[0117] 7. The communication service layer obtains the assembled and packaged service status data, calls the push function, and pushes the assembled and packaged service status data to the client;
[0118] 8. The client obtains the assembled and packaged service status data and displays the service status data on the front-end page;
[0119] 9. When the deployment of business services in the business service layer changes, i.e. when the service status changes, the business service layer calls the service status update center to synchronize the updated target service status data (i.e., the target business status information in the above embodiment) to the service status update center.
[0120] 10. When the service status update center receives the updated target service status data, the service status update center updates the updated target service status data to the database in the storage layer; and triggers the triggers registered in the service status update center to synchronize the updated target service status data to the triggers.
[0121] 11. The trigger receives the updated target service status data, assembles and packages the updated target service status data, caches the data, calls the WebSocket service in the communication service layer, and sends the assembled and packaged target service status data to the WebSocket service.
[0122] 12. The WebSocket service obtains the assembled and packaged target service status data, calls the push capability, and pushes the assembled and packaged target service status data to the client;
[0123] 13. The client obtains the target service status data after assembly and packaging, and updates the service status data on the client's front-end page.
[0124] Optionally, in this embodiment, the step "when the communication module receives the status update instruction, triggers the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol" may include:
[0125] When the communication module receives the status update instruction, it obtains the routing address information of the page currently accessed by the business terminal through the communication module.
[0126] Based on the routing address information, determine whether the service terminal needs to display service status information;
[0127] When the service terminal needs to display service status information, the communication module is triggered to send the assembled and packaged target service status information to the service terminal based on the target communication protocol.
[0128] The routing address information of the page currently accessed by the business terminal can be the routing address information of the page currently displayed by the business terminal. This routing address information can include the IP address and port number. Based on the routing address information, the page currently displayed by the business terminal can be determined, and thus it can be determined whether the page displays business status information. If not, it is not necessary to send the assembled and packaged target business status information to the business terminal.
[0129] Optionally, in this embodiment, the status update instruction includes reference service status information that has been updated historically by the service service layer;
[0130] The step "when the communication module receives the status update instruction, it triggers the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol" may include:
[0131] When the communication module receives the status update instruction, it is triggered to compare the reference service status information with the service status information currently displayed on the service terminal.
[0132] Based on the comparison results, the assembled and packaged target service status information is sent to the service terminal according to the target communication protocol.
[0133] Specifically, the reference business status information can be the business status information corresponding to the last update.
[0134] In this embodiment, the content that the business terminal needs to update for this update can be determined based on whether the business status information currently displayed by the business terminal is consistent with the business status information corresponding to the last update.
[0135] If the service status information currently displayed on the service terminal is consistent with the service status information corresponding to the last update, then the part of the target service status information after this update that is different from the reference service status information corresponding to the last update can be identified as the content that the service terminal needs to update in this update. Only this part of the content will be sent to the service terminal so that the service terminal can update the currently displayed service status information based on this part of the content.
[0136] If the business status information currently displayed on the business terminal is inconsistent with the business status information corresponding to the last update, then all the data of the target business status information to be updated can be sent to the business terminal so that the business terminal can update the currently displayed business status information to the target business status information.
[0137] Optionally, in this embodiment, the step "triggering the communication module to compare the reference service status information with the service status information currently displayed on the service terminal" may include:
[0138] The communication module is triggered to perform a hash operation on the reference service status information to obtain a first hash value;
[0139] A hash operation is performed on the service status information currently displayed by the service terminal to obtain a second hash value;
[0140] Compare the first hash value and the second hash value.
[0141] The first hash value is the message digest corresponding to the reference business status information, and the second hash value is the message digest corresponding to the business status information currently displayed by the business terminal.
[0142] The hash operation may use algorithms such as Secure Hash Algorithm (SHA) and Message Digest Algorithm 5 (MD5), but this embodiment does not limit them.
[0143] A hash function is a cryptographic algorithm primarily used in information security. It transforms an input of arbitrary length into a fixed-length output, called a hash value. This transformation is essentially a compression mapping, meaning the space of hash values is usually smaller than the space of input values. A key property of hash operations is irreversibility; given a hash value, it is extremely difficult to calculate the corresponding message. Different input values correspond to fundamentally different output values, and different output values correspond to different input values. Therefore, it is impossible to determine a unique input value from the hash value; in other words, there is no way to retrieve the original input data from the output hash value.
[0144] Specifically, the first hash value and the second hash value are compared to see if they are the same. If they are the same, the reference service status information is considered to be consistent with the service status information currently displayed on the service terminal; if they are different, the reference service status information is considered to be inconsistent with the service status information currently displayed on the service terminal.
[0145] Optionally, in this embodiment, the step "sending the assembled and packaged target service status information to the service terminal based on the target communication protocol according to the comparison result" may include:
[0146] When the reference service status information is consistent with the service status information currently displayed on the service terminal, the updated target sub-status information is determined from at least one sub-status information of the assembled and packaged target service status information based on the reference service status information.
[0147] The target sub-status information is sent to the service terminal based on the target communication protocol.
[0148] When the reference service status information is inconsistent with the service status information currently displayed on the service terminal, the assembled and packaged target service status information is sent to the service terminal based on the target communication protocol.
[0149] The target service status information may include at least one sub-status information, and the reference service status information may also include at least one sub-status information.
[0150] Specifically, the sub-state information that is not included in the reference business state information in the assembled and packaged target business state information can be determined as the target sub-state information to be updated. In other words, the target sub-state information is the content to be updated this time, and the reference business state information corresponding to the previous update does not include the target sub-state information.
[0151] Specifically, when the reference service status information is consistent with the service status information currently displayed on the service terminal, only a partial data update of the service status data in the service terminal is required; when the reference service status information is inconsistent with the service status information currently displayed on the service terminal, a full data update of the service status data in the service terminal is required.
[0152] Specifically, in different scenarios, triggers assemble data and the WebSocket service pushes data to the client using different strategies, such as a completely indiscriminate push strategy and a differentiated push strategy. The trigger assembling data and the WebSocket service pushing data to the client specifically includes: the trigger receiving the updated target service status data, assembling and packaging the updated target service status data, invoking the WebSocket service in the communication service layer, and pushing the assembled and packaged target service status data to the client.
[0153] In some embodiments, such as Figure 1f The diagram shows the flowchart corresponding to the completely indiscriminate push strategy. Specifically, after the trigger receives the updated target service status data, it assembles and packages all the data, that is, it assembles and packages all the updated target service status data, and calls the WebSocket service in the communication service layer to push the full data, that is, the entire content of the updated target service status data, to all clients corresponding to the WebSocket service without discrimination.
[0154] The completely indiscriminate push strategy is relatively simple to implement, but it sends all data to all clients. Since some clients may not need to display service status data, and in reality, only some service statuses may be updated, pushing all data (i.e., all service statuses) will lead to duplicate data pushes, which will consume network bandwidth resources. This strategy is suitable for situations where the volume of the full service status data is relatively small.
[0155] In other embodiments, such as Figure 1gThe diagram illustrates the flowchart corresponding to the differentiated push strategy. Specifically, after the trigger receives the updated target service status data, it assembles the full data, updated data, and previous full data. Here, the full data refers to the target service status data after this update, the previous full data refers to the service status data corresponding to the previous update, and the updated data refers to the content updated in the target service status data after this update compared to the service status data corresponding to the previous update. Then, it calls the WebSocket service in the communication service layer to send the assembled full data, updated data, and previous full data to the WebSocket service. In addition, the client sends the routing address information of the current page to the WebSocket service, which stores the client's routing address information. When the WebSocket service receives the assembled full data, updated data, and previous full data, it indicates that the service status data has been updated. First, it can determine whether the client needs to update the service status data based on the client's routing address information. For example, if the client switches to a non-service status display page, then it does not need to push the updated service status data to that client. If, based on the client's routing address information, it is determined that the client is currently on a service status display page, then the client needs to update the service status data.
[0156] Specifically, each time the trigger obtains service status data, it can perform a hash operation on the obtained service status data and save the hash value of the full data set. If a client needs to update the service status data, it can determine whether the client needs to update the full data set. The specific process is as follows:
[0157] The WebSocket service can obtain the service status data currently displayed by each client and perform a hash operation on the service status data currently displayed by each client, saving the hash value of the full data for each client. When the service status is updated, the trigger can synchronize the hash value of the full data of the service status data corresponding to the last update to the WebSocket service. The WebSocket service will compare the hash value of the service status data currently displayed by each client with the hash value of the last update of the full data. If they match, only the newly updated service status data needs to be pushed to that client, that is, only the updated data mentioned above needs to be pushed to the client. If they do not match, then the full service status data corresponding to this update needs to be pushed to that client.
[0158] This differentiated push strategy avoids pushing unnecessary data. Specifically, when only a portion of the service status is updated, returning the full data would result in a lot of duplicate data. The differentiated push strategy only returns the updated portion, reducing network bandwidth consumption, decreasing data volume, reducing network request time, and improving update speed. This approach is suitable for scenarios with a large amount of service status data.
[0159] The above two schemes represent two strategies: completely indiscriminate push and differentiated push. Alternatively, a push strategy that compares some differences can be selected based on specific business conditions. This embodiment does not impose any restrictions on this.
[0160] Optionally, in this embodiment, the communication service layer includes at least two distributed communication modules, each of which communicates with at least one service terminal.
[0161] The step "assembling and packaging the target service status information based on the target communication protocol through the status update triggering module, and sending a status update instruction to the communication module of the communication service layer" may include:
[0162] The state update triggering module assembles and packages the target service state information based on the target communication protocol, and sends state update instructions to each communication module of the communication service layer.
[0163] The step "when the communication module receives the status update instruction, it triggers the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol" may include:
[0164] When the communication module receives the status update instruction, it is triggered to send the assembled and packaged target service status information to each service terminal corresponding to the communication module based on the target communication protocol.
[0165] The communication service layer can include one or more communication modules. In other words, the communication service layer can be a cluster of communication modules, specifically a distributed WebSocket service cluster.
[0166] In some embodiments, such as Figure 1h As shown, this is a distributed WebSocket service cluster solution. Specifically, after the trigger receives the updated target service status data, it will assemble and package the entire data, that is, assemble and package all the updated target service status data, call all WebSocket services in the communication service layer, and push the entire data to all clients corresponding to the WebSocket service, that is, push the entire content of the updated target service status data.
[0167] In some embodiments, such as Figure 1i The diagram illustrates a distributed WebSocket service cluster solution. Specifically, after the trigger receives the updated target service status data, it assembles the full data, updated data, and previous full data. Here, the full data refers to the updated target service status data, the previous full data refers to the service status data corresponding to the last update, and the updated data refers to the content updated in the updated target service status data compared to the service status data corresponding to the last update. Then, it calls all WebSocket services in the communication service layer to send the assembled full data, updated data, and previous full data to all WebSocket services. In addition, the client sends the routing address information of the current page to the corresponding WebSocket service, which stores the client's routing address information. When the WebSocket service receives the assembled full data, updated data, and previous full data, it indicates that the service status data has been updated. First, it can determine whether the client needs to update the service status data based on the client's routing address information. For example, if the client switches to a non-service status display page, it is not necessary to push the updated service status data to that client. If the client's routing address information indicates that the client is currently on the service status display page, then the client needs to update the service status data.
[0168] Specifically, each time the trigger obtains service status data, it can perform a hash operation on the obtained service status data and save the hash value of the full data set. If a client needs to update the service status data, it can determine whether the client needs to update the full data. The specific process includes:
[0169] The WebSocket service can obtain the service status data currently displayed by each client and perform a hash operation on the service status data currently displayed by each client, saving the hash value of the full data for each client. When the service status is updated, the trigger can synchronize the hash value of the full data of the service status data corresponding to the last update to all WebSocket services. Each WebSocket service will compare the hash value of the service status data currently displayed by its corresponding client with the hash value of the last update of the full data. If they match, only the newly updated service status data needs to be pushed to that client, that is, only the updated data mentioned above needs to be pushed to the client. If they do not match, then the full service status data corresponding to this update needs to be pushed to that client.
[0170] Both of the above distributed solutions are based on WebSocket connections that connect to different WebSocket services through load balancing. When the trigger updates data, it can call all WebSocket services to ensure that all clients can obtain the correct service status data.
[0171] Optionally, in this embodiment, the target service status information includes the content status data of the client page, and the step "when the service status information of the service layer is updated, receive the updated target service status information sent by the service layer through the status management module" may include:
[0172] When the page content of the client page in the business service layer is updated, the state management module receives a page update instruction containing the content status data sent by the business service layer. The content status data includes the updated page content data of the client page.
[0173] The step "when the status update triggering module is detected to be in a registered state, the target service status information is sent to the status update triggering module" may include:
[0174] When the status update triggering module is detected to be in a registered state, a page update triggering instruction is sent to the status update triggering module, and the page update triggering instruction includes the content status data;
[0175] The step "assembling and packaging the target service status information based on the target communication protocol through the status update triggering module" may include:
[0176] The state update triggering module responds to the page update triggering command and assembles the updated page content data based on the target communication protocol to obtain the assembled page content data.
[0177] The assembled page content data is packaged and compressed to obtain packaged and compressed page content data.
[0178] Optionally, in this embodiment, the status update instruction includes reference business status information that has been updated historically by the business service layer; the reference business status information includes historical content status data of the client page, and the historical content status data includes historical page content data of the client page;
[0179] The step "when the communication module receives the status update instruction, it triggers the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol" may include:
[0180] When the communication module receives the status update instruction, it is triggered to compare the historical page content data with the page content data currently displayed on the business terminal.
[0181] When the historical page content data is inconsistent with the page content data currently displayed on the business terminal, the full amount of the packaged and compressed page content data is sent to the business terminal based on the target communication protocol.
[0182] Specifically, the reference business status information can be the business status information corresponding to the last update; the historical page content data can be the page content data corresponding to the last update of the client page.
[0183] In this embodiment, the content that the business terminal needs to update for this update can be determined based on whether the page content data currently displayed by the business terminal is consistent with the page content data corresponding to the last update.
[0184] If the page content data currently displayed on the business terminal is consistent with the page content data corresponding to the last update, then the part of the page content data after this update that is different from the historical page content data in the reference business status information corresponding to the last update can be identified as the page content data that the business terminal needs to update in this update. Only this part of the page content data will be sent to the business terminal so that the business terminal can update the page content data currently displayed on the business terminal based on this part of the page content data.
[0185] If the page content data currently displayed on the business terminal is inconsistent with the page content data corresponding to the last update, then the full amount of the updated page content data can be sent to the business terminal so that the business terminal can update the currently displayed page content data with the updated page content data in the target business status information.
[0186] Optionally, in this embodiment, the cloud server further includes a storage layer, the storage module of which stores the service status information updated by the service layer; the service status update method may further include:
[0187] When the communication connection with the service terminal is disconnected and then re-established, the communication module receives a request from the service terminal to obtain service status information.
[0188] Based on the acquisition request, the status update triggering module is invoked to retrieve business status information whose update time meets the preset time condition from the storage module;
[0189] The communication module sends the service status information, which states that the update time meets the preset time condition, to the service terminal based on the target communication protocol.
[0190] The preset time condition can specifically be that the update time is the shortest distance from the current time, but this embodiment does not limit this.
[0191] In one embodiment, such as Figure 1j The diagram illustrates the exception handling process for reconnection between the business terminal and the communication module after a disconnection. Specifically, after the client disconnects from the server, it reconnects to the server, i.e., reconnects to the communication module. Then, the client can send a request to the communication module to retrieve the full set of data. Upon receiving the request, the WebSocket service of the communication module calls a trigger to retrieve the full set of service status data. The trigger retrieves the latest updated full set of data from the database in the storage layer and returns it to the WebSocket service. After receiving the full set of data, the WebSocket service pushes the full set of data to the client so that the client can display the full set of service status data.
[0192] Optionally, in this embodiment, the service status update method may further include:
[0193] When the communication connection with the service terminal is disconnected and re-established, and the status management module is detected sending updated service status information to the status update triggering module, the status update triggering module is triggered to assemble and package the updated service status information based on the target communication protocol.
[0194] Send a target status update instruction to the communication module. The target status update instruction includes the assembled and packaged service status information and the historically updated reference service status information.
[0195] When the communication module receives the target status update instruction, it is triggered to compare the reference service status information with the service status information currently displayed by the service terminal.
[0196] Based on the comparison results, the communication module sends the assembled and packaged service status information to the service terminal according to the target communication protocol.
[0197] Among them, the historically updated reference business status information can be the business status information corresponding to the last update.
[0198] In one embodiment, such as Figure 1kThe diagram illustrates the exception handling process for disconnection and reconnection between the business terminal and the communication module. Specifically, when the client disconnects from the server and reconnects to the server (i.e., reconnects to the communication module), if a data update is triggered, the WebSocket service compares the service status data obtained from the last update with the full data of the client's current service status. If a mismatch is found, the WebSocket service pushes the latest updated full data to the client so that the client can view the full service status data.
[0199] Based on the business status update method provided in this application, business status information can be displayed in real time much faster, improving the user experience. After the service status changes at the business service layer, a message can be sent directly from the server to the front-end page, which is an active push update after the service status changes. Compared with the previous polling, it achieves the ultimate in timeliness.
[0200] As can be seen from the above, this embodiment can receive the updated target business status information sent by the business service layer through the status management module when the business status information of the business service layer is updated; detect the registration status of the status update triggering module; when the status update triggering module is detected to be in a registered state, send the target business status information to the status update triggering module; the status update triggering module assembles and packages the target business status information based on the target communication protocol, and sends a status update instruction to the communication module of the communication service layer, the status update instruction including the assembled and packaged target business status information; when the communication module receives the status update instruction, it triggers the communication module to send the assembled and packaged target business status information to the business terminal based on the target communication protocol. This application can use the target communication protocol to push updated business status information to the business terminal, which can avoid the business terminal frequently querying the server for updates, reduce the resource and performance consumption of the server, and achieve real-time updates of business status information.
[0201] Based on the method described in the preceding embodiments, the following will provide a more detailed explanation by taking the specific integration of the business status update device into the server as an example.
[0202] This application provides a service status update method, such as... Figure 2 As shown, the specific process of this business status update method can be as follows:
[0203] 201. When the business status information of the business service layer is updated, the updated target business status information sent by the business service layer is received through the status management module.
[0204] In this embodiment, the service status update method is applicable to a cloud server. The cloud server includes a service service layer, a service status management layer, and a communication service layer. The service status management layer includes a status management module and a status update triggering module.
[0205] The business service layer can be used to deploy services for various businesses. The business deployment process can include at least one step. Specifically, at the beginning and end of each step in the deployment process, the business service layer will call the status management module (i.e., the service status update center) to synchronize the current status of the business service, that is, synchronize the updated target business status information to the status management module.
[0206] The service status management layer is the underlying service corresponding to the business service. It manages the updates of business status information. The service status management layer can include a status management module and a status update triggering module. The status management module is specifically the service status update center, which is mainly responsible for collecting service update status data, storing the updated business status information, receiving registrations from triggers (specifically the status update triggering module), and notifying registered triggers. The status update triggering module is specifically the service status update trigger, which is mainly responsible for registering itself with the service status update center, receiving service update data, querying data from the database (DB), caching data, and invoking WebSocket push capabilities, etc.
[0207] The communication service layer specifically provides the server-side capabilities under the target communication protocol. In some embodiments, the communication service layer can provide HTTP services and WebSocket communication capabilities. The WebSocket communication capabilities can be implemented custom-made or implemented using mature libraries such as Socket.IO.
[0208] In this embodiment, the business status information refers to the background service data of the business, including the status of the business service. Specifically, it can be the detection service status data or the service deployment status during the service deployment process. For example, the service deployment status can be "deployment started," "deployment in progress," or "deployment completed." Specifically, the service deployment status can be presented as a deployment progress bar. The target business status information is specifically the currently updated business status information.
[0209] 202. Detect the registration status of the status update triggering module.
[0210] The registration status of the status update triggering module can include a registered status and an unregistered status. This embodiment can detect whether the status update triggering module is in a registered status; if so, the status management module can send the target service status information to the status update triggering module.
[0211] 203. When the status update triggering module is detected to be in a registered state, the target service status information is sent to the status update triggering module.
[0212] Optionally, before the step "when the status update triggering module is detected to be in a registered state, send the target service status information to the status update triggering module", the service status update method may further include:
[0213] The status management module receives the registration information sent by the status update triggering module.
[0214] Based on the registration information, the registration status of the status update triggering module is updated to "registered".
[0215] The registration information may include the module identifier of the status update triggering module. Based on this registration information, the status management module can authenticate the status update triggering module and update its status from unregistered to registered.
[0216] 204. The state update triggering module assembles and packages the target service state information based on the target communication protocol and sends a state update instruction to the communication module of the communication service layer. The state update instruction includes the assembled and packaged target service state information and the historically updated reference service state information of the service service layer.
[0217] The target communication protocol is the protocol that enables full-duplex communication between the business terminal and the server. For example, the target communication protocol could be the WebSocket protocol.
[0218] WebSocket is a protocol that enables full-duplex communication over a single Transmission Control Protocol (TCP) connection. WebSocket simplifies data exchange between clients and servers, allowing the server to proactively push data to the client. In the WebSocket API (Application Programming Interface), the client and server only need to complete a single handshake to establish a persistent connection and perform bidirectional data transmission.
[0219] Among them, the status update instruction is mainly used to instruct the communication module to send the updated target service status information to the service terminal, so as to update the service status information displayed in the service terminal.
[0220] Specifically, the reference business status information can be the business status information corresponding to the last update.
[0221] 205. When the communication module receives the status update instruction, it obtains the routing address information of the currently accessed page of the business terminal through the communication module.
[0222] The business terminal can be a web browser, a mobile application (App), or a desktop client, etc. This embodiment does not limit this.
[0223] 206. Based on the routing address information, determine whether the service terminal needs to display service status information.
[0224] The routing address information of the page currently accessed by the business terminal can be the routing address information of the page currently displayed by the business terminal. This routing address information can include the IP address and port number. Based on the routing address information, the page currently displayed by the business terminal can be determined, and thus it can be determined whether the page displays business status information. If not, it is not necessary to send the assembled and packaged target business status information to the business terminal.
[0225] 207. When the service terminal needs to display service status information, the communication module is triggered to compare the reference service status information with the service status information currently displayed by the service terminal.
[0226] In this embodiment, the content that the business terminal needs to update for this update can be determined based on whether the business status information currently displayed by the business terminal is consistent with the business status information corresponding to the last update.
[0227] If the service status information currently displayed on the service terminal is consistent with the service status information corresponding to the last update, then the part of the target service status information after this update that is different from the reference service status information corresponding to the last update can be identified as the content that the service terminal needs to update in this update. Only this part of the content will be sent to the service terminal so that the service terminal can update the currently displayed service status information based on this part of the content.
[0228] If the business status information currently displayed on the business terminal is inconsistent with the business status information corresponding to the last update, then all the data of the target business status information to be updated can be sent to the business terminal so that the business terminal can update the currently displayed business status information to the target business status information.
[0229] Optionally, in this embodiment, the step "triggering the communication module to compare the reference service status information with the service status information currently displayed on the service terminal" may include:
[0230] The communication module is triggered to perform a hash operation on the reference service status information to obtain a first hash value;
[0231] A hash operation is performed on the service status information currently displayed by the service terminal to obtain a second hash value;
[0232] Compare the first hash value and the second hash value.
[0233] The first hash value is the message digest corresponding to the reference business status information, and the second hash value is the message digest corresponding to the business status information currently displayed by the business terminal.
[0234] The hash operation may use algorithms such as Secure Hash Algorithm (SHA) and Message Digest Algorithm 5 (MD5), but this embodiment does not limit them.
[0235] Specifically, the first hash value and the second hash value are compared to see if they are the same. If they are the same, the reference service status information is considered to be consistent with the service status information currently displayed on the service terminal; if they are different, the reference service status information is considered to be inconsistent with the service status information currently displayed on the service terminal.
[0236] 208. Based on the comparison results, send the assembled and packaged target service status information to the service terminal according to the target communication protocol.
[0237] Optionally, in this embodiment, the step "sending the assembled and packaged target service status information to the service terminal based on the target communication protocol according to the comparison result" may include:
[0238] When the reference service status information is consistent with the service status information currently displayed on the service terminal, the updated target sub-status information is determined from at least one sub-status information of the assembled and packaged target service status information based on the reference service status information.
[0239] The target sub-status information is sent to the service terminal based on the target communication protocol.
[0240] When the reference service status information is inconsistent with the service status information currently displayed on the service terminal, the assembled and packaged target service status information is sent to the service terminal based on the target communication protocol.
[0241] The target service status information may include at least one sub-status information, and the reference service status information may also include at least one sub-status information.
[0242] Specifically, the sub-state information that is not included in the reference business state information in the assembled and packaged target business state information can be determined as the target sub-state information to be updated. In other words, the target sub-state information is the content to be updated this time, and the reference business state information corresponding to the previous update does not include the target sub-state information.
[0243] Specifically, when the reference service status information is consistent with the service status information currently displayed on the service terminal, only a partial data update of the service status data in the service terminal is required; when the reference service status information is inconsistent with the service status information currently displayed on the service terminal, a full data update of the service status data in the service terminal is required.
[0244] As can be seen from the above, this embodiment can receive the updated target business status information sent by the business service layer through the status management module when the business status information of the business service layer is updated; detect the registration status of the status update triggering module; when the status update triggering module is detected to be in a registered state, send the target business status information to the status update triggering module; the status update triggering module assembles and packages the target business status information based on the target communication protocol and sends a status update instruction to the communication module of the communication service layer. The status update instruction includes the assembled and packaged target business status information and the historically updated reference business status information of the business service layer; when the communication module receives the status update instruction, it obtains the routing address information of the page currently accessed by the business terminal; based on the routing address information, it determines whether the business terminal needs to display business status information; when the business terminal needs to display business status information, it triggers the communication module to compare the reference business status information with the business status information currently displayed by the business terminal; according to the comparison result, it sends the assembled and packaged target business status information to the business terminal based on the target communication protocol. This application can push updated service status information to the service terminal using the target communication protocol. This avoids the service terminal frequently querying the server for updates, reduces the server's resource and performance consumption, and enables real-time updates of service status information.
[0245] To better implement the above methods, this application also provides a business status update device suitable for cloud servers. The cloud server includes a business service layer, a service status management layer, and a communication service layer. The service status management layer includes a status management module and a status update triggering module, such as... Figure 3As shown, the service status update device may include a receiving unit 301, a detection unit 302, a first sending unit 303, an assembly unit 304, and a second sending unit 305, as follows:
[0246] (1) Receiving unit 301;
[0247] The receiving unit is used to receive the updated target service status information sent by the service service layer through the status management module when the service status information of the service service layer is updated.
[0248] (2) Detection unit 302;
[0249] The detection unit is used to detect the registration status of the status update triggering module.
[0250] Optionally, in some embodiments of this application, the service status update device may further include a registration unit, as follows:
[0251] The registration unit is used to receive registration information sent by the status update triggering module through the status management module; and based on the registration information, update the registration status of the status update triggering module to the registered status.
[0252] (3) First transmitting unit 303;
[0253] The first sending unit is used to send the target service status information to the status update triggering module when the status update triggering module is detected to be in a registered state.
[0254] (4) Assembly unit 304;
[0255] The assembly unit is used to assemble and package the target service status information based on the target communication protocol through the status update triggering module, and send a status update instruction to the communication module of the communication service layer. The status update instruction includes the assembled and packaged target service status information.
[0256] (5) Second transmitting unit 305;
[0257] The second sending unit is used to trigger the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol when the communication module receives the status update instruction.
[0258] Optionally, in some embodiments of this application, the cloud server further includes a storage layer, the storage module of which stores the service status information updated by the service layer; the service status update device may further include a service status acquisition unit, as follows:
[0259] The service status acquisition unit is configured to, based on the communication connection established between the communication module and the service terminal under the target communication protocol, receive a request for acquiring service status information sent by the service terminal through the communication module; based on the acquisition request, call the status update triggering module to acquire service status information from the storage module; and send the service status information to the service terminal through the communication module based on the target communication protocol.
[0260] Optionally, in some embodiments of this application, the second sending unit may include a routing address acquisition subunit, a judgment subunit, and a first sending subunit, as follows:
[0261] The routing address acquisition subunit is used to acquire the routing address information of the currently accessed page of the business terminal through the communication module when the communication module receives the status update instruction.
[0262] The judgment subunit is used to determine, based on the routing address information, whether the service terminal needs to display service status information;
[0263] The first sending subunit is used to trigger the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol when the service terminal needs to display service status information.
[0264] Optionally, in some embodiments of this application, the status update instruction includes reference service status information that has been historically updated by the service service layer; the second sending unit may include a comparison subunit and a second sending subunit, as follows:
[0265] The comparison subunit is used to trigger the communication module to compare the reference service status information with the service status information currently displayed on the service terminal when the communication module receives the status update instruction.
[0266] The second sending subunit is used to send the assembled and packaged target service status information to the service terminal based on the target communication protocol according to the comparison result.
[0267] Optionally, in some embodiments of this application, the comparison subunit may be specifically used to trigger the communication module to perform a hash operation on the reference service status information to obtain a first hash value; perform a hash operation on the service status information currently displayed by the service terminal to obtain a second hash value; and compare the first hash value and the second hash value.
[0268] Optionally, in some embodiments of this application, the second sending subunit may be specifically used to determine, based on the reference service status information, from at least one sub-status information of the assembled and packaged target service status information when the reference service status information is consistent with the service status information currently displayed by the service terminal; and to send the target sub-status information to the service terminal based on the target communication protocol when the reference service status information is inconsistent with the service status information currently displayed by the service terminal.
[0269] Optionally, in some embodiments of this application, the cloud server further includes a storage layer, the storage module of which stores the service status information updated by the service layer; the service status update device may further include a first reconnection unit, as follows:
[0270] The first reconnection unit is configured to, when the communication connection with the service terminal is disconnected and a new communication connection is established, receive a request for obtaining service status information sent by the service terminal through the communication module; based on the request, call the status update triggering module to obtain service status information whose update time meets a preset time condition from the storage module; and send the service status information whose update time meets the preset time condition to the service terminal through the communication module based on the target communication protocol.
[0271] Optionally, in some embodiments of this application, the service status update device may further include a second connection reconstruction unit, as follows:
[0272] The second reconnection unit is configured to, when disconnecting from the service terminal and re-establishing the communication connection, and detecting that the status management module is currently sending updated service status information to the status update triggering module, trigger the status update triggering module to assemble and package the updated service status information based on the target communication protocol; send a target status update instruction to the communication module, the target status update instruction including the assembled and packaged service status information and historically updated reference service status information; when the communication module receives the target status update instruction, trigger the communication module to compare the reference service status information with the service status information currently displayed by the service terminal; and, based on the comparison result, send the assembled and packaged service status information to the service terminal through the communication module based on the target communication protocol.
[0273] Optionally, in some embodiments of this application, the communication service layer includes at least two distributed communication modules, each communication module communicating with at least one service terminal;
[0274] The assembly unit can be specifically used to assemble and package the target service status information based on the target communication protocol through the status update triggering module, and send status update instructions to each communication module of the communication service layer respectively.
[0275] The second sending unit can be specifically used to trigger the communication module to send the assembled and packaged target service status information to each service terminal corresponding to the communication module based on the target communication protocol when the communication module receives the status update instruction.
[0276] Optionally, in some embodiments of this application, the target business status information includes content status data of the client page. Specifically, the receiving unit can be used to receive a page update instruction containing the content status data sent by the business service layer through the status management module when the page content of the client page in the business service layer is updated. The content status data includes the updated page content data of the client page.
[0277] The first sending unit can be specifically used to send a page update triggering instruction to the status update triggering module when the status update triggering module is detected to be in a registered state. The page update triggering instruction includes the content status data.
[0278] Specifically, the assembly unit can be used to respond to the page update triggering instruction through the state update triggering module, assemble the updated page content data based on the target communication protocol to obtain assembled page content data; and perform packaging and compression processing on the assembled page content data to obtain packaged and compressed page content data.
[0279] Optionally, in some embodiments of this application, the status update instruction includes reference business status information that has been updated historically by the business service layer; the reference business status information includes historical content status data of the client page, and the historical content status data includes historical page content data of the client page;
[0280] Specifically, the second sending unit can be used to trigger the communication module to compare the historical page content data with the page content data currently displayed by the business terminal when the communication module receives the status update instruction; when the historical page content data is inconsistent with the page content data currently displayed by the business terminal, the unit can send the full amount of the packaged and compressed page content data to the business terminal based on the target communication protocol.
[0281] As can be seen from the above, in this embodiment, when the service status information of the service layer is updated, the receiving unit 301 receives the updated target service status information sent by the service layer through the status management module; the detection unit 302 detects the registration status of the status update triggering module; when the status update triggering module is detected to be in a registered state, the first sending unit 303 sends the target service status information to the status update triggering module; the assembly unit 304 assembles and packages the target service status information based on the target communication protocol through the status update triggering module, and sends a status update instruction to the communication module of the communication service layer, the status update instruction including the assembled and packaged target service status information; when the communication module receives the status update instruction, the second sending unit 305 triggers the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol. This application can use the target communication protocol to push updated service status information to the service terminal, which can avoid the service terminal frequently querying the server for updates, reduce the resource and performance consumption of the server, and realize real-time updates of service status information.
[0282] This application also provides an electronic device, such as... Figure 4 The diagram shows a schematic representation of the structure of an electronic device according to an embodiment of this application. This electronic device can be a terminal or a server, specifically:
[0283] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0284] The processor 401 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes software programs and / or modules stored in the memory 402, and calls data stored in the memory 402, to perform various functions and process data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.
[0285] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0286] The electronic device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0287] The electronic device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0288] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402 to realize various functions, as follows:
[0289] When the service status information of the service layer is updated, the status management module receives the updated target service status information sent by the service layer; the registration status of the status update triggering module is detected; when the status update triggering module is detected to be registered, the target service status information is sent to the status update triggering module; the status update triggering module assembles and packages the target service status information based on the target communication protocol and sends a status update instruction to the communication module of the communication service layer, the status update instruction including the assembled and packaged target service status information; when the communication module receives the status update instruction, it is triggered to send the assembled and packaged target service status information to the service terminal based on the target communication protocol.
[0290] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0291] As can be seen from the above, this embodiment can receive the updated target business status information sent by the business service layer through the status management module when the business status information of the business service layer is updated; detect the registration status of the status update triggering module; when the status update triggering module is detected to be in a registered state, send the target business status information to the status update triggering module; the status update triggering module assembles and packages the target business status information based on the target communication protocol, and sends a status update instruction to the communication module of the communication service layer, the status update instruction including the assembled and packaged target business status information; when the communication module receives the status update instruction, it triggers the communication module to send the assembled and packaged target business status information to the business terminal based on the target communication protocol. This application can use the target communication protocol to push updated business status information to the business terminal, which can avoid the business terminal frequently querying the server for updates, reduce the resource and performance consumption of the server, and achieve real-time updates of business status information.
[0292] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0293] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the service state update methods provided in embodiments of this application. For example, the instructions can execute the following steps:
[0294] When the service status information of the service layer is updated, the status management module receives the updated target service status information sent by the service layer; the registration status of the status update triggering module is detected; when the status update triggering module is detected to be registered, the target service status information is sent to the status update triggering module; the status update triggering module assembles and packages the target service status information based on the target communication protocol and sends a status update instruction to the communication module of the communication service layer, the status update instruction including the assembled and packaged target service status information; when the communication module receives the status update instruction, it is triggered to send the assembled and packaged target service status information to the service terminal based on the target communication protocol.
[0295] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0296] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0297] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the service status update methods provided in the embodiments of this application, the beneficial effects that any of the service status update methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0298] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations of the above-described business state update aspect.
[0299] The above provides a detailed description of a service status update method and related equipment provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A business status update method, characterized in that, Applicable to cloud servers, the cloud server includes a business service layer, a service status management layer, and a communication service layer, the service status management layer includes a status management module and a status update triggering module, and the method includes: When the business status information of the business service layer is updated, the updated target business status information sent by the business service layer is received through the status management module. The registration status of the status update triggering module is detected; When the status update triggering module is detected to be in a registered state, the target service status information is sent to the status update triggering module; The state update triggering module assembles and packages the target service state information based on the target communication protocol and sends a state update instruction to the communication module of the communication service layer. The state update instruction includes the assembled and packaged target service state information and the historically updated reference service state information of the service service layer. The reference service state information is the service state information corresponding to the last update. When the communication module receives the status update instruction, it is triggered to send the assembled and packaged target service status information to the service terminal based on the target communication protocol. This includes: when the communication module receives the status update instruction, it is triggered to compare the reference service status information with the service status information currently displayed by the service terminal; when the reference service status information is consistent with the service status information currently displayed by the service terminal, it determines the updated target sub-status information from at least one sub-status information of the assembled and packaged target service status information based on the reference service status information, wherein sub-status information in the assembled and packaged target service status information that is not included in the reference service status information is determined as the target sub-status information; it sends the target sub-status information to the service terminal based on the target communication protocol; when the reference service status information is inconsistent with the service status information currently displayed by the service terminal, it sends the assembled and packaged target service status information to the service terminal based on the target communication protocol.
2. The method according to claim 1, characterized in that, Before sending the target service status information to the status update triggering module when the status update triggering module is detected to be in a registered state, the method further includes: The status management module receives the registration information sent by the status update triggering module. Based on the registration information, the registration status of the status update triggering module is updated to "registered".
3. The method according to claim 1, characterized in that, The cloud server also includes a storage layer, and the storage module of the storage layer stores the business status information updated by the business service layer. The method further includes: Based on the communication connection established between the communication module and the service terminal under the target communication protocol, the communication module receives the service terminal's request for obtaining service status information. Based on the acquisition request, the status update triggering module is invoked to obtain business status information from the storage module; The communication module sends the service status information to the service terminal based on the target communication protocol.
4. The method according to claim 1, characterized in that, When the communication module receives the status update instruction, it triggers the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol, including: When the communication module receives the status update instruction, it obtains the routing address information of the page currently accessed by the business terminal through the communication module. Based on the routing address information, determine whether the service terminal needs to display service status information; When the service terminal needs to display service status information, the communication module is triggered to send the assembled and packaged target service status information to the service terminal based on the target communication protocol.
5. The method according to claim 1, characterized in that, The step of triggering the communication module to compare the reference service status information with the service status information currently displayed on the service terminal includes: The communication module is triggered to perform a hash operation on the reference service status information to obtain a first hash value; A hash operation is performed on the service status information currently displayed by the service terminal to obtain a second hash value; Compare the first hash value and the second hash value.
6. The method according to claim 1, characterized in that, The target service status information includes content status data of the client page. When the service status information of the service layer is updated, the updated target service status information sent by the service layer is received through the status management module, including: When the page content of the client page in the business service layer is updated, the state management module receives a page update instruction containing the content status data sent by the business service layer. The content status data includes the updated page content data of the client page. The step of sending the target service status information to the status update triggering module when the status update triggering module is detected to be in a registered state includes: When the status update triggering module is detected to be in a registered state, a page update triggering instruction is sent to the status update triggering module, and the page update triggering instruction includes the content status data; The process of assembling and packaging the target service status information based on the target communication protocol through the status update triggering module includes: The state update triggering module responds to the page update triggering command and assembles the updated page content data based on the target communication protocol to obtain the assembled page content data. The assembled page content data is packaged and compressed to obtain packaged and compressed page content data.
7. The method according to claim 6, characterized in that, The reference service status information includes the historical content status data of the client page, and the historical content status data includes the historical page content data of the client page. When the communication module receives the status update instruction, it is triggered to compare the reference service status information with the service status information currently displayed on the service terminal, including: When the communication module receives the status update instruction, it is triggered to compare the historical page content data with the page content data currently displayed on the business terminal.
8. The method according to claim 1, characterized in that, The cloud server further includes a storage layer, and the storage module of the storage layer stores the business status information updated by the business service layer; the method further includes: When the communication connection with the service terminal is disconnected and then re-established, the communication module receives a request from the service terminal to obtain service status information. Based on the acquisition request, the status update triggering module is invoked to retrieve business status information whose update time meets the preset time condition from the storage module; The communication module sends the service status information, which states that the update time meets the preset time condition, to the service terminal based on the target communication protocol.
9. The method according to claim 1, characterized in that, The method further includes: When the communication connection with the service terminal is disconnected and re-established, and the status management module is detected sending updated service status information to the status update triggering module, the status update triggering module is triggered to assemble and package the updated service status information based on the target communication protocol. Send a target status update instruction to the communication module. The target status update instruction includes the assembled and packaged service status information and the historically updated reference service status information. When the communication module receives the target status update instruction, it is triggered to compare the reference service status information with the service status information currently displayed by the service terminal. Based on the comparison results, the communication module sends the assembled and packaged service status information to the service terminal according to the target communication protocol.
10. The method according to claim 1, characterized in that, The communication service layer includes at least two distributed communication modules, each of which communicates with at least one service terminal. The step of assembling and packaging the target service status information based on the target communication protocol through the status update triggering module, and sending a status update instruction to the communication module of the communication service layer, includes: The state update triggering module assembles and packages the target service state information based on the target communication protocol, and sends state update instructions to each communication module of the communication service layer.
11. A business status update device, characterized in that, Applicable to cloud servers, the cloud server includes a business service layer, a service status management layer, and a communication service layer, the service status management layer includes a status management module and a status update triggering module, and the device includes: The receiving unit is used to receive the updated target service status information sent by the service service layer through the status management module when the service status information of the service service layer is updated. The detection unit is used to detect the registration status of the status update triggering module; The first sending unit is used to send the target service status information to the status update triggering module when the status update triggering module is detected to be in a registered state. An assembly unit is used to assemble and package the target service status information based on the target communication protocol through the status update triggering module, and send a status update instruction to the communication module of the communication service layer. The status update instruction includes the assembled and packaged target service status information and the historically updated reference service status information of the service service layer. The reference service status information is the service status information corresponding to the last update. The second sending unit is configured to, when the communication module receives the status update instruction, trigger the communication module to send the assembled and packaged target service status information to the service terminal based on the target communication protocol. The unit includes: a comparison subunit, configured to, when the communication module receives the status update instruction, trigger the communication module to compare the reference service status information with the service status information currently displayed by the service terminal; and a second sending subunit, configured to, when the reference service status information matches the service status information currently displayed by the service terminal, determine the updated target sub-status information from at least one sub-status information of the assembled and packaged target service status information based on the reference service status information, wherein sub-status information in the assembled and packaged target service status information that is not included in the reference service status information is determined as the target sub-status information; send the target sub-status information to the service terminal based on the target communication protocol; and when the reference service status information does not match the service status information currently displayed by the service terminal, send the assembled and packaged target service status information to the service terminal based on the target communication protocol.
12. An electronic device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor runs the application program within the memory to perform the operations in the business status update method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the service status update method according to any one of claims 1 to 10.
14. A computer program product comprising a computer program or instructions that, when executed by a processor, implement the steps of the business status update method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Interface data updating method, server and client
CN108509510A
Web page state updating method and device based on distributed instant push
CN113037834A
Message pushing method and device, server, electronic equipment and storage medium
CN113905090A
