Method and system for user information communication synchronization

By concatenating login credentials and Uniform Resource Locators between the user client and the HTML5 client, the problem of low communication efficiency between the mini-program platform and the web view is solved, achieving real-time synchronization and efficient communication of user information.

CN116016558BActive Publication Date: 2025-12-23HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211593356.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-12
Publication Date
2025-12-23
Estimated Expiration
2042-12-12

AI Technical Summary

Technical Problem

In existing technologies, the communication efficiency between the mini-program platform and the webview is low, and the synchronization of user information can only be achieved in specific scenarios, resulting in non-real-time and inefficient communication.

Method used

After receiving a login request from the HTML5 client, the client performs the login operation and concatenates the login credentials with a Uniform Resource Locator (URI) to form a target URI, which is then sent to the HTML5 client. The HTML5 client then extracts the login credentials to obtain the user information, thus achieving communication synchronization between the client and the web application.

Benefits of technology

It improves the communication efficiency between the user end and web services, enables real-time information synchronization during page transitions, and solves the problem of communication being limited to specific scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016558B_ABST
    Figure CN116016558B_ABST
Patent Text Reader

Abstract

The application provides a method and system for user information communication synchronization, which can be applied to the technical field of data processing. A user terminal receives a login request sent by an html5 terminal, performs a user login operation, and the login request includes a uniform resource locator to be accessed after the user login is successful; login credential information of the user login operation is obtained, the login credential information is spliced with the uniform resource locator to obtain a target uniform resource locator; and the target uniform resource locator is sent to the html5 terminal; the html5 terminal receives the target uniform resource locator, extracts login credential information from the target uniform resource locator, and obtains user information based on the login credential information. In this way, the login credential information of the user login operation is carried in the uniform resource locator and sent to the html5 terminal, the login credential information is extracted by the html5 terminal, and the user information is obtained based on the login credential information, so that the communication efficiency of the user terminal and web service can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to a user information communication synchronization method and system. BACKGROUND

[0002] Currently, the applet platform of the user end and the web service carried by the web view usually use the postmessage method for communication. However, the communication using the postmessage method is limited to specific scenarios, and only in specific scenarios can the user end where the applet is located receive the message and the web view obtain the user information of the applet. Therefore, the communication mode limited to specific scenarios has the problem of low communication efficiency. SUMMARY

[0003] Therefore, the present application provides a user information communication synchronization method and system, which can improve the communication efficiency between the user end and the web service.

[0004] To solve the above problems, the technical scheme provided by the present application is as follows:

[0005] In a first aspect, the present application provides a user information communication synchronization method, which comprises:

[0006] The user end receives a login request sent by an html5 end, performs a user login operation, and the login request includes a uniform resource locator to be accessed after the user login is successful;

[0007] The user end obtains login credential information of the user login operation, splices the login credential information with the uniform resource locator, and obtains a target uniform resource locator;

[0008] The user end sends the target uniform resource locator to the html5 end;

[0009] The html5 end receives the target uniform resource locator, extracts login credential information from the target uniform resource locator, and obtains user information based on the login credential information.

[0010] In a possible implementation manner, the login request further includes a usehash parameter, the hash parameter is used to indicate whether to splice the login credential information with the hash part of the uniform resource locator, and the splicing of the login credential information with the uniform resource locator comprises:

[0011] The html5 end obtains a location.href attribute, and compares whether the location.href attribute and the uniform resource locator are the same;

[0012] if the usehash parameter indicates that the login credential information is to be concatenated with the hash portion of the uniform resource locator, and the location.href attribute is the same as the uniform resource locator, then the user end concatenates the login credential information with the hash portion of the uniform resource locator;

[0013] if the usehash parameter indicates that the login credential information is to be concatenated with the hash portion of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, or if the usehash parameter indicates that the login credential information is not to be concatenated with the hash portion of the uniform resource locator, then the user end concatenates the login credential information with the search portion of the uniform resource locator.

[0014] In one possible implementation, the if the usehash parameter indicates that the login credential information is to be concatenated with the hash portion of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, then the user end concatenates the login credential information with the search portion of the uniform resource locator, includes:

[0015] if the usehash parameter indicates that the login credential information is to be concatenated with the hash portion of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, then resetting the usehash parameter;

[0016] based on the reset usehash parameter, indicating that the user end concatenates the login credential information with the search portion of the uniform resource locator.

[0017] In one possible implementation, if the login credential information is concatenated with the search portion of the uniform resource locator, the method further includes:

[0018] resetting a scr attribute of a web view component to an empty string;

[0019] assigning the target uniform resource locator to the scr attribute;

[0020] in response to performing a return operation, clearing a history route stack record.

[0021] In one possible implementation, if the login credential information is concatenated with the hash portion of the uniform resource locator, the method further includes:

[0022] The html5 end triggers a hashchange event;

[0023] In response to performing the extracting of the login credential information from the target uniform resource locator, storing the login credential information into cookie data, and calling history.back() to clear a repeated history route stack record.

[0024] In a possible implementation, before receiving the login request sent by the html5 end at the user end, the method further includes:

[0025] determining whether the user has logged in;

[0026] If the user has logged in, the html5 end instructs the user end to splice the login credential information and a search part of the uniform resource locator.

[0027] In a possible implementation, if the user has not logged in, the method further includes:

[0028] Before sending the login request at the html5 end, pre-clearing cookie data.

[0029] In a second aspect, the application provides a system for user information synchronization communication, and the system includes:

[0030] a user end configured to receive a login request sent by a html5 end, perform a user login operation, obtain login credential information of the user login operation, splice the login credential information and a uniform resource locator, obtain a target uniform resource locator, and send the target uniform resource locator to the html5 end, wherein the login request includes a uniform resource locator to be accessed after the user logs in successfully;

[0031] the html5 end configured to send a login request to the user end, receive the target uniform resource locator sent by the user end, extract login credential information from the target uniform resource locator, and obtain user information based on the login credential information.

[0032] In a possible implementation, the login request further includes a usehash parameter, the hash parameter is used to indicate whether to splice the login credential information and a hash part of the uniform resource locator, and the html5 end is further configured to:

[0033] obtain a location.href attribute, and compare the location.href attribute with the uniform resource locator to determine whether they are the same;

[0034] if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, and the location.href attribute is the same as the uniform resource locator, instructing the user end to concatenate the login credential information with the hash part of the uniform resource locator;

[0035] if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, or if the usehash parameter indicates that the login credential information is not to be concatenated with the hash part of the uniform resource locator, instructing the user end to concatenate the login credential information with the search part of the uniform resource locator.

[0036] In a possible implementation, if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, the html5 end is specifically configured to:

[0037] if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, resetting the usehash parameter;

[0038] instructing the user end to concatenate the login credential information with the search part of the uniform resource locator based on the reset usehash parameter.

[0039] In a possible implementation, the user end is specifically configured to:

[0040] resetting a scr attribute of a web view component to an empty string, assigning the target uniform resource locator to the scr attribute, and clearing a history route stack record in response to performing a return operation.

[0041] In a possible implementation, the html5 end is specifically configured to:

[0042] triggering a hashchange event, storing the login credential information into a cookie data in response to performing the extracting of the login credential information from the target uniform resource locator, and calling history.back() to clear a repeated history route stack record.

[0043] In a possible implementation, the html5 end is specifically configured to:

[0044] determining whether the user has logged in, and if the user has logged in, instructing the user end to splice the login credential information with the search part of the uniform resource locator.

[0045] In one possible implementation, the html5 end is specifically configured to:

[0046] If the user has not logged in, the cookie data is cleared in advance before the login request is sent.

[0047] In a third aspect, the present application provides a device for user information synchronization communication, comprising: a processor, a memory, a system bus;

[0048] The processor and the memory are connected through the system bus;

[0049] The memory is configured to store one or more programs, the one or more programs comprising instructions that, when executed by the processor, cause the processor to perform the method for user information synchronization communication of the first aspect described above.

[0050] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing instructions, when the instructions run on a terminal device, cause the terminal device to perform the method for user information synchronization communication of the first aspect described above.

[0051] Therefore, the present application has the following beneficial effects:

[0052] The present application provides a method and system for user information communication synchronization, a user end receives a login request sent by an html5 end, performs a user login operation, the login request includes a uniform resource locator to be accessed after the user login is successful; login credential information of the user login operation is obtained, the login credential information is spliced with the uniform resource locator to obtain a target uniform resource locator; the target uniform resource locator is sent to the html5 end; the html5 end receives the target uniform resource locator and extracts login credential information from the target uniform resource locator, and user information is obtained based on the login credential information. In this way, the login credential information of the user login operation is carried in the uniform resource locator and sent to the html5 end, the login credential information is extracted by the html5 end and the user information is obtained based on the login credential information, the communication synchronization between the user end and the web service is realized when the page jumps, and the communication efficiency between the user end and the web service can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 The flowchart of the method for user information communication synchronization provided by the embodiments of the present application is shown.

[0054] Figure 2 a flowchart of a method for user information communication synchronization provided by an embodiment of the present application;

[0055] Figure 3 a structural block diagram of a system for user information communication synchronization provided by an embodiment of the present application. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0057] In the present application, the term “comprising” or “including” or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement “comprising a” does not exclude the presence of another identical element in the process, method, article or equipment including the element.

[0058] Currently, the applet platform of the user end and the web business carried by the webview usually use the postmessage method for communication, but this communication method is limited to three specific scenarios of applet back, component destruction and sharing. Only in these three specific scenarios, the applet can receive the message. Based on the limitation of the platform, the webview can only obtain the user information transmitted by the applet in these three specific scenarios. The probability of the web business touching the three scenarios of applet back, component destruction and sharing is small, and other web businesses also need to obtain user information. Therefore, it is impossible to communicate user information in real time, and the communication between the user end and the web business limited to specific scenarios has the problem of low communication efficiency.

[0059] Based on this, the application provides a user information communication synchronization method and system. A user terminal receives a login request sent by an html5 terminal, performs a user login operation, and the login request includes a uniform resource locator to be accessed after the user login is successful. The user terminal obtains login credential information of the user login operation, splices the login credential information and the uniform resource locator to obtain a target uniform resource locator, and sends the target uniform resource locator to the html5 terminal. The html5 terminal receives the target uniform resource locator, extracts login credential information from the target uniform resource locator, and obtains user information based on the login credential information. In this way, the login credential information of the user login operation is carried in the uniform resource locator and sent to the html5 terminal. The html5 terminal extracts the login credential information and obtains user information based on the login credential information. The communication between the user terminal and the web service is synchronized during page jumping, and the communication efficiency between the user terminal and the web service can be improved.

[0060] It should be noted that the applet is an application that can be used without downloading and installation. Users can call the applet by scanning the code or searching. The webview can be embedded in the mobile terminal to realize hybrid development of the front end. Most hybrid development frameworks are based on the webview mode for secondary development, such as APIcloud, uni-app, and other frameworks. PostMessage is a commonly used function in the Windows API, which is used to put a message into a message queue. The message in the message queue can be obtained by calling GetMessage and PeekMessage.

[0061] In order to facilitate understanding of the technical solutions provided by the embodiments of the application, a user information communication synchronization method and system provided by the embodiments of the application will be described below with reference to the accompanying drawings.

[0062] Referring to Figure 1 , Figure 1 The flowchart of the user information communication synchronization method provided by the embodiments of the application specifically includes the following steps S101-S104.

[0063] S101: The user terminal receives a login request sent by the html5 terminal, performs a user login operation, and the login request includes a uniform resource locator to be accessed after the user login is successful.

[0064] In this embodiment, the user terminal receives a login request sent by the html5 terminal, and the login request is used to instruct the user terminal to perform a user login operation. Referring to Figure 2 , Figure 2The flowchart of the method for user information communication synchronization provided by the embodiments of the present application is shown. In a possible implementation, before receiving the login request sent by the html5 end, the method further includes: judging whether the user has logged in; if the user has logged in, the html5 end instructs the user end to splice the login credential information with the search part of the uniform resource locator, and then assigns the target uniform resource locator after splicing to the src attribute of the webview component.

[0065] When the user end, i.e., the applet end, interacts with the html5 page, it is first judged whether the user has logged in. If not, the corresponding user login operation is performed. On the basis that the user has logged in, the html5 end can instruct the user end to access which uniform resource locator url when returning the webview, and instruct the user end to splice the login credential information token into the search part of the uniform resource locator url. The html5 extracts the login credential information token, which can be exchanged for user information, and the user information is checked to verify the validity of the user and the current login state. It should be noted that the present application takes the user end as an example of the applet end, but it is not limited to this application scenario.

[0066] In a possible implementation, if the user has not logged in, the method further includes: clearing the cookie data in advance before the login request sent by the html5 end.

[0067] If it is determined that the user has not logged in, the html5 end will clear the cookie data in advance to avoid errors in searching for the login credential information token. In a possible implementation, whether the user has logged in is determined by the uniform resource locator url and history.length: if the login credential information token is not found from the uniform resource locator url, and history.length==1, it indicates that the user has not logged in on the applet, and at this time, the login credential information token saved in the cookie data needs to be cleared.

[0068] In a possible implementation, when it is determined that the user login operation needs to be performed on the applet, the wx.miniProgram.navigateTo() method is called to call up the applet login page and pass the login request, which includes the uniform resource locator to be accessed after the user logs in successfully.

[0069] S102: The user end obtains the login credential information of the user login operation, splices the login credential information with the uniform resource locator, and obtains the target uniform resource locator.

[0070] The user end receives a login request sent by the html5 end, the login request carrying a uniform resource locator to be accessed after the user logs in successfully. In a possible implementation, the login request further includes a usehash parameter, the hash parameter being used to indicate whether the login credential information is to be spliced with the hash part of the uniform resource locator. The splicing of the login credential information with the uniform resource locator includes: the html5 end acquires a location.href attribute, and compares the location.href attribute with the uniform resource locator; if the usehash parameter indicates that the login credential information is to be spliced with the hash part of the uniform resource locator, and the location.href attribute is the same as the uniform resource locator, the user end splices the login credential information with the hash part of the uniform resource locator; if the usehash parameter indicates that the login credential information is to be spliced with the hash part of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, or if the usehash parameter indicates that the login credential information is not to be spliced with the hash part of the uniform resource locator, the user end splices the login credential information with the search part of the uniform resource locator.

[0071] The user end involves two pages, a webview page and a login page. After the login page logs in successfully, it is determined that the previous page of the applet page stack of the user end is the webview page, and the html5 end saves current page parameters for subsequent use. The current page parameters include an html5 address (uniform resource locator url) to be accessed after login succeeds and a usehash parameter used to indicate whether login credential information token is to be spliced into the url. The webview page reads the parameters params saved by the login page in the onshow hook. The params.url is the link of the html5 to be loaded after login succeeds, and is the link of the html5 to be called to log in by default. If the html5 page to be jumped to after login is other, a corresponding value can be passed by the url.

[0072] In the embodiments of the present application, there are two ways to splice the login credential information token with the uniform resource locator url, the first way being to splice the login credential information token with the hash part of the uniform resource locator, and the second way being to splice the login credential information token with the search part of the uniform resource locator.

[0073] If the usehash parameter indicates that the login credential information is spliced with the hash part of the uniform resource locator, and the location.href attribute is the same as the uniform resource locator url, i.e. params.usehash == 1, the first splicing scheme is adopted, and the user end splices the login credential information token with the hash part of the uniform resource locator url.

[0074] If the usehash parameter indicates that the login credential information token is spliced with the hash part of the uniform resource locator url, but the location.href attribute is not the same as the uniform resource locator url, or if the usehash parameter indicates that the login credential information token is not spliced with the hash part of the uniform resource locator url, the second splicing scheme is adopted, and the user end splices the login credential information token with the search part of the uniform resource locator url.

[0075] In the case that the user has logged in, the second splicing scheme is adopted.

[0076] In a possible implementation manner, if the usehash parameter indicates that the login credential information is spliced with the hash part of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, the user end splices the login credential information with the search part of the uniform resource locator, comprising: if the usehash parameter indicates that the login credential information is spliced with the hash part of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, resetting the usehash parameter; based on the reset usehash parameter, the user end splices the login credential information with the search part of the uniform resource locator.

[0077] Specifically, if the usehash parameter indicates that the login credential information token is spliced with the hash part of the uniform resource locator url, i.e. params.usehash == 1, but the location.href attribute is not the same as the uniform resource locator url, and the hashchange event is not triggered, the second splicing scheme is adopted. The usehash parameter is reset, and at this time, params.usehash == 0. The user end splices the login credential information with the search part of the uniform resource locator, and obtains the target uniform resource locator returnurl after splicing.

[0078] Assigning the target uniform resource locator retumurl to the src attribute of the webview component pushes a record to the history route stack. When the retumurl is consistent with the html5 address that invokes the user login, it means that the history route stack will have a duplicate record. When the user performs a return operation after a successful login, the user may return from the retumurl page carrying the login credential information token to the nurl page without the login credential information token. To solve the problem of duplicate records in the history route stack, two solutions are provided in the embodiments of the present application.

[0079] Solution one:

[0080] In a possible implementation, if the login credential information is spliced with the search part of the uniform resource locator, the method further includes: resetting the scr attribute of the webview component to an empty string; assigning the target uniform resource locator to the scr attribute; and in response to performing a return operation, clearing the history route stack record.

[0081] Corresponding to params.usehash == 0, the webview component uses wx:if to bind its src attribute. The src attribute of the webview is first set to an empty string, and after a preset time is delayed by calling setTimeout, the retumurl carrying the token is assigned to the src. Due to the existence of wx:if, the history route stack record existing before the webview component is destroyed and then re-rendered is also destroyed. The purpose of clearing the duplicate records in the history route stack is achieved. However, the disadvantage of re-rendering the webview component through wx:if is that the previous history record will be lost, and the user will directly close the webview page when performing a click return operation. This solution is applicable to the case where the webview does not exist internal jump.

[0082] Solution two:

[0083] In a possible implementation, if the login credential information is spliced with the hash part of the uniform resource locator, the method further includes: triggering the html5 end to listen to the hashchange event; in response to performing the extraction of the login credential information from the target uniform resource locator, storing the login credential information into the cookie data, and calling history.back() to clear the duplicate history route stack record.

[0084] When params.usehash == 1, the login credential information token is added to the hash part of the url, html5 automatically listens to the hashchange event. After the user login is completed, the login credential information token is obtained, the token is stored in the cookie data, and then the history.back() method is called to clear the repeated history route stack record. Meanwhile, the page can also be refreshed by location.relaod() to complete the login process. The second scheme does not need to re-render the webview, only the repeated record is cleared, and the previous history record is retained. It should be noted that when the hash of the url has other uses, such as hash routing, page anchor, etc., the first scheme is used to clean the repeated history route stack record.

[0085] The embodiments of the present application can solve the problem of login operation caused by the location.href jump in html5, maintain the purity of the webview history route stack record, and further solve the problem of page state refresh after login success.

[0086] S103: The user end sends the target uniform resource locator to the html5 end.

[0087] In a possible implementation manner, the user end sends the target uniform resource locator returnurl to the src attribute of the webview component, and then sends it to the html5 end. The sending manner in the embodiments of the present application is not limited, and can be selected according to actual needs.

[0088] S104: The html5 end receives the target uniform resource locator, extracts the login credential information from the target uniform resource locator, and obtains the user information based on the login credential information.

[0089] After the html5 end receives the target uniform resource locator, the login credential information token is found from the returnurl and the cookie. After the login credential information token is extracted, the user information is queried by using the extracted login credential information token. The login credential information token is sequentially found from the url and the cookie, and the login state and the user information are obtained.

[0090] Based on the above S101-S104, it is known that the user terminal receives a login request sent by the HTML5 terminal and performs a user login operation. The login request includes a Uniform Resource Locator (URL) to be accessed after successful login. The user terminal obtains login credential information for the login operation, concatenates the login credential information with the URL to obtain a target URL, and sends the target URL to the HTML5 terminal. The HTML5 terminal receives the target URL, extracts the login credential information from it, and obtains user information based on the login credential information. Thus, by sending the user login credential information along with the URL to the HTML5 terminal, and having the HTML5 terminal extract the login credential information and obtain user information from it, communication synchronization between the user terminal and the web service is achieved during page transitions, improving the communication efficiency between the user terminal and the web service.

[0091] The foregoing embodiments of this application provide a method for user information synchronization communication based on the above description. Next, a system for user information synchronization communication is also provided in the embodiments of this application, which performs the aforementioned... Figure 1 The method shown below will be followed by a description of the functions of the user information synchronization communication system. The structural block diagram of the user information synchronization communication system is shown below. Figure 3 As shown, this includes: client-side 301 and HTML5-side 302.

[0092] Client 301 is used to receive login requests sent by the HTML5 client, perform user login operations, and obtain login credential information for user login operations. The login credential information is concatenated with the Uniform Resource Locator (URL) to obtain a target URL, and the target URL is sent to the HTML5 client. The login request includes the URL to be accessed after the user successfully logs in.

[0093] The HTML5 client 302 is used to send a login request to the user client, receive a target Uniform Resource Locator (URL) sent by the user client, extract login credential information from the URL, and obtain user information based on the login credential information.

[0094] In one possible implementation, the login request further includes a usehash parameter, the hash parameter indicating whether to concatenate the login credential information with the hash portion of the Uniform Resource Locator. The HTML5 endpoint 302 is also used for:

[0095] Get the location.href property and compare whether the location.href property is the same as the Uniform Resource Locator.

[0096] if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, and the location.href attribute is the same as the uniform resource locator, instructing the user end to concatenate the login credential information with the hash part of the uniform resource locator;

[0097] if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, or if the usehash parameter indicates that the login credential information is not to be concatenated with the hash part of the uniform resource locator, instructing the user end to concatenate the login credential information with the search part of the uniform resource locator.

[0098] In a possible implementation, if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, the html5 end 302 is specifically configured to:

[0099] if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, resetting the usehash parameter;

[0100] instructing the user end to concatenate the login credential information with the search part of the uniform resource locator based on the reset usehash parameter.

[0101] In a possible implementation, the user end 301 is specifically configured to:

[0102] resetting a scr attribute of a web view component to an empty string, assigning the target uniform resource locator to the scr attribute, and clearing a history route stack record in response to performing a return operation.

[0103] In a possible implementation, the html5 end 302 is specifically configured to:

[0104] triggering a hashchange event, storing the login credential information into a cookie data in response to performing the extracting of the login credential information from the target uniform resource locator, and calling history.back() to clear a repeated history route stack record.

[0105] In a possible implementation, the html5 end 302 is specifically configured to:

[0106] determine whether the user has logged in, and if the user has logged in, instruct the user end to splice the login credential information with the search part of the uniform resource locator.

[0107] In a possible implementation, the html5 end 302 is specifically configured to:

[0108] If the user has not logged in, the cookie data is cleared in advance before the login request is sent.

[0109] The embodiments of the present application provide a system for user information synchronization communication, which comprises a user end and an html5 end. The user end is configured to receive a login request sent by the html5 end, perform a user login operation, obtain login credential information of the user login operation, splice the login credential information with a uniform resource locator, obtain a target uniform resource locator, and send the target uniform resource locator to the html5 end. The login request comprises a uniform resource locator to be accessed after the user login is successful. The html5 end is configured to send a login request to the user end, receive the target uniform resource locator sent by the user end, extract login credential information from the target uniform resource locator, and obtain user information based on the login credential information. In this way, the login credential information of the user login operation is carried in the uniform resource locator and sent to the html5 end, the login credential information is extracted by the html5 end, and the user information is obtained based on the login credential information. The communication synchronization between the user end and the web service is realized when the page is switched, and the communication efficiency between the user end and the web service can be improved.

[0110] Based on the method for user information synchronization communication provided in the above method embodiments, the embodiments of the present application further provide a device for user information synchronization communication, which comprises a processor, a memory, and a system bus.

[0111] The processor and the memory are connected through the system bus.

[0112] The memory is configured to store one or more programs, and the one or more programs comprise instructions which, when executed by the processor, cause the processor to perform the method for user information synchronization communication according to any one of the above embodiments.

[0113] Based on the method embodiment of the user information synchronization communication method provided in the above method embodiment, the embodiment of the present application further provides a computer readable storage medium, wherein instructions are stored in the computer readable storage medium, and when the instructions are run on a terminal device, the terminal device executes the user information synchronization communication method of any one of the above embodiments.

[0114] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the system or system embodiments, since it is basically similar to the method embodiments, it is described more simply, and the related parts can be referred to the part of the method embodiments. The above described system and system embodiments are merely illustrative, wherein the units described as separate components can be or can not be physically separated, and the components displayed as units can be or can not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to the actual needs. Those skilled in the art can understand and implement without creative labor.

[0115] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical scheme. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0116] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method of synchronizing user information communication, characterized by, The method comprises: The user terminal receives a login request sent by an html5 terminal, performs a user login operation, and the login request comprises a uniform resource locator to be accessed after the user login is successful; The user terminal obtains login credential information of the user login operation, splices the login credential information with the uniform resource locator, and obtains a target uniform resource locator; The user terminal sends the target uniform resource locator to the html5 terminal; The html5 terminal receives the target uniform resource locator, extracts login credential information from the target uniform resource locator, and obtains user information based on the login credential information; If the login credential information is spliced with a search part of the uniform resource locator, the method further comprises: Resetting a scr attribute of a webpage view component to an empty string; Assigning the target uniform resource locator to the scr attribute; In response to performing a return operation, clearing a history route stack record; If the login credential information is spliced with a hash part of the uniform resource locator, the method further comprises: The html5 terminal triggers a hashchange event; In response to performing the extraction of the login credential information from the target uniform resource locator, storing the login credential information in cookie data, and calling history.back() to clear a repeated history route stack record.

2. The method of claim 1, wherein, The login request further comprises a usehash parameter, the hash parameter is used to indicate whether the login credential information is spliced with a hash part of the uniform resource locator, and the splicing of the login credential information with the uniform resource locator comprises: The html5 terminal obtains a location.href attribute, and compares whether the location.href attribute and the uniform resource locator are the same; If the usehash parameter indicates that the login credential information is spliced with the hash part of the uniform resource locator, and the location.href attribute and the uniform resource locator are the same, the user terminal splices the login credential information with the hash part of the uniform resource locator; If the usehash parameter indicates that the login credential information is spliced with the hash part of the uniform resource locator, but the location.href attribute and the uniform resource locator are not the same, or if the usehash parameter indicates that the login credential information is not spliced with the hash part of the uniform resource locator, the user terminal splices the login credential information with a search part of the uniform resource locator.

3. The method of claim 2, wherein, The splicing of the login credential information with the search part of the uniform resource locator when the usehash parameter indicates that the login credential information is spliced with the hash part of the uniform resource locator, but the location.href attribute and the uniform resource locator are not the same, comprises: if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, and the location.href attribute is identical to the uniform resource locator, then instructing the user end to concatenate the login credential information with the hash part of the uniform resource locator; based on the reset usehash parameter, instructing the user end to concatenate the login credential information with the search part of the uniform resource locator.

4. The method of claim 1, wherein, Before the user end receives the login request sent by the html5 end, the method further comprises: determining whether the user has logged in; if the user has logged in, then the html5 end instructs the user end to concatenate the login credential information with the search part of the uniform resource locator.

5. The method of claim 4, wherein, if the user has not logged in, then the method further comprises: before the login request sent by the html5 end, pre-clearing cookie data.

6. A system for user information synchronization communication, characterized by The system comprises: a user end, configured to receive a login request sent by an html5 end, perform a user login operation, obtain login credential information of the user login operation, concatenate the login credential information with a uniform resource locator, obtain a target uniform resource locator, and send the target uniform resource locator to the html5 end, wherein the login request comprises a uniform resource locator to be accessed after the user logs in successfully; the html5 end, configured to send a login request to the user end, receive the target uniform resource locator sent by the user end, extract login credential information from the target uniform resource locator, and obtain user information based on the login credential information; if the login credential information is concatenated with the search part of the uniform resource locator, then: resetting a scr attribute of a web view component to an empty string; assigning the target uniform resource locator to the scr attribute; and in response to an execution return operation, clearing a history route stack record; if the login credential information is concatenated with the hash part of the uniform resource locator, then: the html5 end triggers a hashchange event; in response to an execution of the extracting of the login credential information from the target uniform resource locator, storing the login credential information into cookie data, and calling history.back() to clear a duplicate history route stack record.

7. The system of claim 6, wherein, The login request further comprises a usehash parameter, the hash parameter is used to indicate whether the login credential information is to be concatenated with the hash part of the uniform resource locator, and the html5 end is further configured to: obtain a location.href attribute, and compare whether the location.href attribute is identical to the uniform resource locator; if the usehash parameter indicates that the login credential information is to be concatenated with the hash part of the uniform resource locator, and the location.href attribute is identical to the uniform resource locator, then instructing the user end to concatenate the login credential information with the hash part of the uniform resource locator; if the usehash parameter indicates that the login credential information is to be concatenated with the hash portion of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, or if the usehash parameter indicates that the login credential information is not to be concatenated with the hash portion of the uniform resource locator, then instructing the user end to concatenate the login credential information with the search portion of the uniform resource locator.

8. The system of claim 7, wherein, The html5 end is specifically used in that if the usehash parameter indicates that the login credential information is to be concatenated with the hash portion of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, then: if the usehash parameter indicates that the login credential information is to be concatenated with the hash portion of the uniform resource locator, but the location.href attribute is not the same as the uniform resource locator, then resetting the usehash parameter; based on the reset usehash parameter, instructing the user end to concatenate the login credential information with the search portion of the uniform resource locator.

Citation Information

Patent Citations

  • Method, device and system for displaying application embedded in applet

    CN114816637A