Text switching method and device, electronic equipment and storage medium
By identifying trigger events and obtaining identification information, intelligently responding and playing preset connection animations, the flickering problem of electronic display system during text switching is solved, improving user experience and improving information loading efficiency.
Patent Information
- Application Number
- CN202510135622.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-05-09
AI Technical Summary
When text, images or video content is quickly updated or switched, electronic display systems are prone to flickering, causing drivers to be distracted and visually tired, increasing driving safety hazards and affecting user experience.
By identifying the current trigger event and obtaining its corresponding identification information, we intelligently judge the user's intentions, respond when appropriate, and play preset connection animations when it takes time to load the target text information to alleviate user waiting anxiety and improve user experience.
It effectively avoids flickering during text switching, reduces user waiting anxiety, improves the overall user experience, and improves the efficiency of information loading while ensuring the user experience.
Smart Images

Figure CN119960886A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of interface design, and in particular to a text switching method, device, electronic device, and computer-readable storage medium. Background Art
[0002] With the development of technology, display technology is undergoing a profound transformation from traditional dashboards to advanced electronic display systems. This change not only greatly enriches the types of vehicle information that drivers can obtain, but also significantly improves the intuitiveness and readability of vehicle information. For example, the common electronic display system full LCD dashboard and central control large screen can display vehicle speed, fuel level, engine status, navigation map, entertainment system status and various warnings and prompts of driving assistance systems in real time, providing drivers with a highly integrated and easy-to-understand interactive interface.
[0003] However, while enjoying the convenience and efficiency brought by electronic displays, there are also some technical challenges. One of the most intuitive problems that affects the user experience is the flickering phenomenon when the interface switches. This flickering usually occurs when text, images or video content is quickly updated or switched on the electronic screen. This flickering phenomenon will not only distract the driver's attention, but may also cause visual fatigue, and even increase the driver's driving safety risks to a certain extent, affecting the user experience. Summary of the invention
[0004] To solve the above technical problems, the embodiments of the present application provide a text switching method and device, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] According to one aspect of an embodiment of the present application, a text switching method is provided, including: obtaining identification information corresponding to a current trigger event, the identification information being used to determine target text information corresponding to the current trigger event and a duration corresponding to the target text information; if the duration is greater than a preset duration threshold, obtaining the corresponding current text information on an interface; if the current text information indicates that the interface is blank text, obtaining a preset connection animation; responding to the current trigger event and controlling the preset connection animation to play until the interface loads the target text information.
[0006] According to one aspect of an embodiment of the present application, the response to the current trigger event and the control of the preset connection animation to play until the target text information is loaded into the interface include: determining the playback start time corresponding to the target text information based on the identification information; determining the playback end time of the preset connection animation based on the playback start time; responding to the current trigger event and controlling the preset connection animation to play until the playback end time.
[0007] According to one aspect of an embodiment of the present application, determining the playback start time corresponding to the target text information based on the identification information includes: obtaining the current operating environment, determining the loading duration of the target text information based on the operating environment; and determining the playback end time based on the loading duration.
[0008] According to one aspect of an embodiment of the present application, determining the playback start time corresponding to the target text information based on the identification information includes: obtaining the data size corresponding to the target text information; determining the playback duration of the preset connection animation based on the data size, and determining the playback end time based on the playback duration.
[0009] According to one aspect of an embodiment of the present application, determining the playback duration of the preset connection animation based on the data size includes: if the data size is greater than or equal to a preset data threshold, determining the playback duration of the preset connection animation to be a first preset playback duration; if the data size is less than the preset data threshold, determining the playback duration of the preset connection animation to be a second preset playback duration, and the second playback duration is less than the first preset playback duration.
[0010] According to one aspect of an embodiment of the present application, the method also includes: if the current text information represents non-blank text on the interface, determining the playback duration and current playback time of the current text based on the current animation information; and determining the playback start time of the target text information based on the playback duration and current playback time of the current text.
[0011] According to one aspect of an embodiment of the present application, the method also includes: determining a text switching type based on the target text information and the current target text information; determining a text switching switch based on the text switching type, the text switching switch being used to distinguish different state machines, and controlling the display or hiding of a data label on the interface through the state machine, the data label including a data node for triggering an event, so as to access the preset connection animation or access the target text information through the data node.
[0012] According to one aspect of an embodiment of the present application, a text switching device is provided, including: a first acquisition module, acquiring identification information corresponding to a current trigger event, wherein the identification information is used to determine target text information corresponding to the current trigger event and a duration corresponding to the target text information; a second acquisition module, acquiring the corresponding current text information on an interface if the duration is greater than a preset duration threshold; a third acquisition module, acquiring a preset connection animation if the current text information indicates that the interface is blank text; and a control module, responding to the current trigger event and controlling the preset connection animation to play until the interface loads the target text information.
[0013] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the text switching method as described above.
[0014] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the text switching method as described above.
[0015] According to one aspect of an embodiment of the present application, a computer program product is also provided, including a computer program, which implements the steps in the text switching method described above when executed by a processor.
[0016] In the technical solution provided in the embodiments of the present application, by identifying the current trigger event and obtaining its corresponding identification information, the mechanism can intelligently judge the user's intention and respond at the appropriate time. When the target text information requires a certain amount of time to load, by playing the preset connection animation, the user's waiting anxiety can be effectively alleviated and the overall user experience can be improved. On the other hand, by judging the preset duration threshold, the mechanism can avoid playing unnecessary connection animations when the text information is loaded too quickly, thereby ensuring the user experience while improving the efficiency of information loading. In addition, the connection animation avoids the flashing of the last triggered text when new text appears, affecting the user experience.
[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0019] Figure 1 is a schematic diagram of an implementation environment for text switching shown in an exemplary embodiment of the present application;
[0020] Figure 2 is a flowchart of a text switching method shown in an exemplary embodiment of the present application;
[0021] Figure 3is a flowchart of a text switching method shown in another exemplary embodiment of the present application;
[0022] Figure 4 is a flowchart of a text switching method shown in another exemplary embodiment of the present application;
[0023] Figure 5 is a flowchart of a text switching method shown in another exemplary embodiment of the present application;
[0024] Figure 6 is a flowchart of a text switching method shown in another exemplary embodiment of the present application;
[0025] Figure 7 is a flowchart of a text switching method shown in another exemplary embodiment of the present application;
[0026] Figure 8 is a flowchart of a text switching method shown in another exemplary embodiment of the present application;
[0027] Fig. 9 is a schematic diagram of a brief process of text switching in an exemplary application scenario;
[0028] Fig.10 is a block diagram of a text switching device shown in an exemplary embodiment of the present application;
[0029] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0030] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0031] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0032] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0033] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0034] Kanzi provides a wealth of tools and features for creating and optimizing the user interface of the in-vehicle system, including text elements. Developers can quickly define the layout, style, and behavior of text without having to write complex code from scratch. Kanzi supports parallel processing and efficient memory management strategies, which helps reduce development time and resource consumption and improve overall development efficiency. Kanzi supports a variety of operating systems and hardware platforms, including Windows, Linux, QNX, etc. This means that developers can use Kanzi to deploy and run their applications on different devices without having to develop text components separately for each platform. In addition, Kanzi provides high-quality text rendering capabilities and supports multiple fonts, font sizes, and color settings. This helps ensure that the text is clear and readable in the in-vehicle system and improves the user experience. Kanzi provides clear API documentation and custom plug-in functions, allowing developers to easily integrate Kanzi with their in-vehicle systems or software. At the same time, developers can also create custom text components and attribute types as needed to meet specific needs.
[0035] Figure 1 FIG. 1 is a schematic diagram of an implementation environment of text switching according to an exemplary embodiment of the present application. Figure 1As shown, the target text information to be displayed in the next step is triggered on the smart terminal 110, and then a trigger event is generated on the smart terminal 110. After that, the server 120 obtains the identification information corresponding to the current trigger event of the user. The information is used to determine the target text information corresponding to the current trigger event and the duration corresponding to the target text information. If the duration of the target text information is greater than the preset duration threshold, the server 120 obtains the current text information corresponding to the interface of the smart terminal 110. If the current text information indicates that the interface is blank text, the server 120 obtains the preset connection animation, responds to the current trigger event, and controls the preset connection animation to play to the interface of the smart terminal 110 to load the target text information. In this way, the text switching is realized on the interface of the smart terminal 110.
[0036] in, Figure 1 The smart terminal 110 shown can be any terminal device that supports text display, such as a smart phone, a car computer, a tablet computer, a laptop computer, or a wearable device, but is not limited thereto. Figure 1 The server 120 shown, for example, can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms, which are not limited here. The smart terminal 110 can communicate with the server 120 through wireless networks such as 3G (third generation mobile information technology), 4G (fourth generation mobile information technology), and 5G (fifth generation mobile information technology), which are not limited here.
[0037] In the prior art, Kanzi is used to develop texts in actual development. Because a large amount of text will be used, Kanzi will import a text plug-in to switch the display of the text. In actual development, a resource identifier will be automatically switched according to the function. This resource identifier will obtain the corresponding text in the declassified text table. In some cases, when the resource identifier represents the trigger in which the hidden function of the plug-in is called to not display the text, the hidden function of the plug-in will retain the last text, which will cause the last triggered text to flash once the next time new text appears, seriously affecting the user experience.
[0038] The above-mentioned problems are generally applicable in the scenario of text opening based on Kanzi. In order to solve these problems, the embodiments of the present application respectively propose a text switching method, a text switching device, an electronic device, a computer-readable storage medium and a computer program product, which will be described in detail below.
[0039] See also Figure 2 , Figure 2 is a flowchart of a text switching method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown is specifically executed by the server 120 in the implementation environment. It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.
[0040] Exemplarily, the smart terminal to which the text switching method disclosed in this embodiment is applicable may be installed with a graphical user interface (GUI) framework developed by Kanzi, and the method disclosed in this embodiment is specifically implemented as one or more functions provided by Kanzi to the outside.
[0041] like Figure 2 As shown, in an exemplary embodiment, the text switching method at least includes steps S210 to S240, which are described in detail as follows:
[0042] Step S210, obtaining identification information corresponding to the current triggering event, where the identification information is used to determine the target text information corresponding to the current triggering event and the duration corresponding to the target text information.
[0043] Exemplarily, in actual use, the currently triggered event is captured through an event listener or event processing mechanism. This can be events such as clicks, slides, loads, timers, etc. on the user interface. Each triggered event should have a unique identification information (such as event ID, event type, timestamp, etc.), which can be used for subsequent search and processing. Among them, the event ID can be that each event will have a unique ID when it is triggered, the event type (such as click, load, scroll, etc.) can help distinguish different events, and the timestamp can record the time when the event is triggered, which helps to determine the order and relative time of the event. According to the identification information of the event, it is mapped to predefined or dynamically generated text information. This can be achieved through database queries, configuration files, or data structures in memory. The text information ID can be that each text information has a unique ID, which is associated with the event identification information. The specific text content can be a string, HTML fragment, or other format. The duration of the target text information may be determined by multiple factors, such as user settings, system configuration or the nature of the event itself, including the following aspects: for certain types of events, the duration may be a preset fixed value or dynamically calculated according to the specific circumstances and context of the event, such as the speed and frequency of user operations. The duration may also be obtained from the user or other system inputs.
[0044] Step S220: If the duration is greater than the preset duration threshold, the corresponding current text information on the interface is obtained.
[0045] Exemplarily, first check whether the duration of the triggering event exceeds a preset duration threshold, which is preset according to business requirements or user preferences. After confirming that the duration exceeds the duration threshold, it is necessary to ensure that the user interface (UI) has been updated to the latest state so as to obtain the most accurate current text information, and then obtain the text information displayed on the current terminal interface.
[0046] Step S230: if the current text information representation interface is blank text, a preset connection animation is obtained.
[0047] Exemplarily, the current text message content obtained from the interface is checked. If the text message is an empty string, contains only spaces or specific tags (such as <blank>), it is considered blank text. Once it is confirmed that the text information is blank, it is necessary to further verify whether the interface is really blank. This may involve checking whether other elements or components on the interface are also blank or hidden, and selecting a suitable transition animation from the animation library according to pre-set rules or configurations. Among them, the selection of transition animations may be based on a variety of factors, such as user preferences, application themes, differences in the front and back interfaces, etc., to ensure that the required animation resources (such as pictures, videos, GIFs, etc.) are loaded and ready. If the animation is dynamically generated, the animation parameters and effects must be calculated in advance.
[0048] Step S240, responding to the current triggering event, and controlling the preset connection animation to play until the interface loads the target text information.
[0049] Exemplarily, the selected connection animation is displayed on the interface to attract the user's attention and provide a visual transition effect. In this embodiment, it may be necessary to call the animation playback function provided by the UI framework and set appropriate animation parameters, and then play the animation at the same time or immediately to start loading the target text information. This may involve steps such as obtaining data from the server, processing data, and updating the UI, and continuously monitoring the loading progress of the target text information, which can be achieved by checking the state of data loading, the response of the network request, etc. In some achievable embodiments, the playback of the connection animation is synchronized with the loading progress of the target text information. For example, when the data is loaded to a certain proportion, the playback speed or progress of the animation can be adjusted to provide a smoother transition effect. If the data is loaded quickly, the animation may need to be ended in advance; if the loading is slow, the animation may need to be looped or the playback time may be extended. That is, when the target text information is loaded and ready to be displayed on the interface, stop playing the connection animation to avoid the animation and the target text information appearing on the interface at the same time.
[0050] In some embodiments of the present application, by identifying the current trigger event and obtaining its corresponding identification information, the mechanism can intelligently judge the user's intention, and then respond at the appropriate time. When the target text information takes a certain amount of time to load, by playing the preset connection animation, the user's waiting anxiety can be effectively alleviated, and the overall user experience can be improved. By judging by the preset duration threshold, the mechanism can avoid playing unnecessary connection animations when the text information is loaded too quickly, thereby ensuring the user experience while also improving the efficiency of information loading. On the other hand, the connection animation avoids the flashing of the last triggered text when new text appears, affecting the user experience.
[0051] Based on the above examples, please refer to Figure 3 In one of the exemplary embodiments provided in the present application, the specific implementation process of responding to the current trigger event and controlling the preset connection animation to play until the interface loads the target text information may also include steps S310 to S330, which are described in detail as follows:
[0052] Step S310, determining the playback start time corresponding to the target text information based on the identification information;
[0053] Step S320, determining a preset end time of playback of the connection animation based on the playback start time;
[0054] Step S330, responding to the current triggering event, and controlling the preset connection animation to play until the play end time.
[0055] Exemplarily, identification information is parsed from the received data, and this information is usually used to indicate when the target text information should start to be played or displayed.
[0056] The identification information may be a timestamp, a relative time (such as "5 seconds after loading is completed") or a specific signal. According to the parsed identification information, the specific time when the target text information should start to be played or displayed is calculated.
[0057] This may involve converting the timestamp to local time, or calculating the absolute time based on the relative time. Based on the calculated start time, determine when the preset transition animation should end. This usually means that you need to know the duration of the transition animation and subtract this duration from the start time to get the end time. If the duration of the transition animation is variable (for example, dynamically adjusted based on the loading progress), you may need to select an appropriate algorithm to calculate the end time. When the current trigger event (such as user click, data loading completion, etc.) is detected, prepare to play the preset transition animation. Start playing the transition animation from the time the trigger event occurs, and continue playing until the previously calculated end time is reached. If the animation has a loop setting, but the end time has been reached, the animation needs to be stopped at that moment. Once the transition animation reaches the end time, immediately display the target text information on the interface. Make sure that the animation has completely stopped when the text information is displayed to avoid visual conflicts between the two.
[0058] In some embodiments of the present application, by precisely controlling the playback time of the connecting animation to ensure that the animation ends at the appropriate moment and then displays the target text information, this smooth transition and timely response can enhance the user's overall experience, and by dynamically adjusting the animation playback deadline according to the loading time of the target text information, the continuity of the interface transition can be ensured to avoid users feeling abrupt or confused.
[0059] Based on the above examples, please refer to Figure 4 In one of the exemplary embodiments provided in the present application, the specific implementation process of determining the playback start time corresponding to the target text information based on the identification information may also include step S410 and step S420, which are described in detail as follows:
[0060] Step S410, obtaining the current operating environment, and determining the loading time of the target text information based on the operating environment;
[0061] Step S420: determining a playback deadline based on the loading duration.
[0062] The current operating environment information is obtained, which may include the performance of the device corresponding to the text display interface (such as CPU, memory, network speed, etc.), the version of the operating system, the status of the application (such as foreground or background operation), and other factors that may affect the loading speed. Based on the current operating environment, the loading time of the target text information is evaluated. This may involve the analysis of historical data (such as the previous loading time under the same environment), the evaluation of device performance, and the prediction of network conditions. In some achievable embodiments, the loading progress can also be monitored in real time, and the estimation of the loading time can be dynamically adjusted according to the progress. According to business needs or user preferences, an expected play start time (i.e., when to start playing the connection animation) is determined. Based on the evaluated loading time and the expected play start time, the play deadline is calculated. The play deadline should be the moment when the loading is completed and the target text information is ready to be displayed, minus the duration of the connection animation (if the animation needs to be fully played before the text information is displayed). Then, when the expected play start time arrives, the preset connection animation can be played on the interface, and the animation play progress can be continuously monitored to stop playing the preset connection animation when the play deadline arrives.
[0063] In some embodiments of the present application, by obtaining the current operating environment (such as network speed, device performance, etc.), the method can dynamically adjust the loading time of the target text information. This means that under different device and network conditions, appropriate responses can be made to ensure the consistency of user experience and make adjustments based on the current operating environment, which increases the flexibility of interface design and can fine-tune the connection animation according to different device and network conditions to adapt to different user needs and usage scenarios.
[0064] Based on the above examples, please refer to Figure 5 In one of the exemplary embodiments provided in the present application, the specific implementation process of determining the playback start time corresponding to the target text information based on the identification information may also include step S510 and step S520, which are described in detail as follows:
[0065] Step S510, obtaining the data size corresponding to the target text information;
[0066] Step S520, determining the playing duration of the preset connection animation based on the data size, and determining the playing deadline based on the playing duration.
[0067] Exemplarily, before requesting to load the target text information, the data size of the text information is obtained by sending a request to the server or checking the metadata stored locally. This size is usually expressed in bytes, and the current network connection speed or the processing power of the device is evaluated to predict the time required to load the target text information. Among them, it can be achieved by analyzing historical data, monitoring the network status in real time, or using device performance information. The evaluation result obtained may be an average speed or a speed range. According to the data size of the target text information and the evaluated loading speed, a reasonable transition animation playback duration is calculated. The obtained playback duration should match the expected loading time to ensure that the animation ends before or just when the text information is loaded. The calculation of the playback duration may need to consider some additional factors, such as user preferences (whether to like longer transition animations), application style (whether to pursue quick response) or business rules (whether to require a specific animation duration). Determine a suitable playback start time based on business needs or the context of user interaction. This is usually the moment when the user triggers an action (such as clicking a button). Based on the calculated playback duration and playback start time, determine the playback deadline. The playback deadline should be the time when the text information is expected to load, or slightly earlier to ensure that the animation does not cover the display of the text information.
[0068] In some embodiments of the present application, the playback duration of the preset connection animation is accurately calculated by the data size, so that the playback of the animation can be matched with the time the user waits for the target text information to load. This avoids the situation where the animation is played too long, causing the user to wait anxiously, or the animation is played too short and appears abrupt, which helps to improve the coherence and fluency of the interface interaction, so that the user can get a consistent and pleasant experience throughout the use process.
[0069] Based on the above embodiments, please refer to Figure 6 In one of the exemplary embodiments provided in the present application, the specific implementation process of determining the playback duration of the preset connection animation based on the data size may also include step S610 and step S620, which are described in detail as follows:
[0070] Step S610, if the data size is greater than or equal to the preset data threshold, determining the playback duration of the preset connection animation as the first preset playback duration;
[0071] Step S620: If the data size is smaller than the preset data threshold, the playback duration of the preset connection animation is determined to be a second preset playback duration, and the second playback duration is smaller than the first preset playback duration.
[0072] Exemplarily, a preset data threshold is first set, and this threshold is used to distinguish whether the data size of the target text information belongs to the category of "large" or "small". The setting of the threshold can be determined according to various factors such as actual application scenarios, user preferences, network conditions, etc. Before or during the request to load the target text information, the data size of the text information is obtained. This size is usually expressed in units such as bytes (Bytes) or kilobytes (KB), megabytes (MB). The data size of the target text information is compared with the preset data threshold. If the data size is greater than or equal to the preset data threshold, it is considered that the data is large and may take longer to load. If the data size is less than the preset data threshold, it is considered that the data is small and the loading time may be shorter. According to the comparison result, the playback time of the preset connection animation is determined. If the data is large, the playback time is determined to be the first preset playback time, which is usually longer, so as to provide the user with sufficient loading time and reduce the anxiety caused by waiting. If the data is small, the playback time is determined to be the second preset playback time, which is usually shorter, to ensure that the animation does not excessively prolong the user's waiting time.
[0073] In one embodiment provided in the present application, different playback durations are selected according to the data size to ensure that the animation playback matches the user's waiting time. When the data is large, a longer animation can provide a visual buffer for the user and reduce the anxiety of waiting; when the data is small, a shorter animation can quickly transition to the target content and reduce unnecessary waiting time. This dynamic adjustment helps to improve user experience satisfaction.
[0074] Based on the above examples, please refer to Figure 7 In one of the exemplary embodiments provided in the present application, the specific implementation process of the above text switching method may also include step S710 and step S720, which are described in detail as follows:
[0075] Step S710, if the current text information representation interface is not blank text, determine the playing duration of the current text and the current playing time based on the current animation information;
[0076] Step S720, determining the start time of playing the target text information based on the playing duration of the current text and the current playing time.
[0077] Exemplarily, check whether the text information displayed on the current interface is non-blank text. This usually means that the text information contains characters with actual meaning, rather than blank or default text that is just a placeholder. If the current text information is non-blank, then obtain the animation information associated with the text information. This may include the animation playback duration, current playback time, animation type (such as fade-in, fade-out, sliding, etc.) and any other parameters that may affect the animation playback. Based on the acquired animation information, determine the playback duration of the current text (i.e., the time required for the entire animation from start to end) and the current playback time (i.e., the time the animation has currently been played). With the playback duration and current playback time of the current text, the playback start time of the target text information can be calculated. This usually means waiting for the current animation to finish (if the goal is to display new text immediately after the animation ends), or determining the start time according to some logic (such as starting to display new text when the animation plays to a certain point). Before or at the same time as determining the playback start time, prepare the target text information and any animation effects associated with it. This may include loading text content, selecting an appropriate animation type, setting animation parameters, etc.
[0078] In this embodiment, by accurately calculating the playback duration of the current text and the current playback time, it is possible to accurately predict when a seamless transition to the target text information can be made. This ensures that the interface remains smooth and coherent when switching texts. Users will experience a more natural and smooth interface interaction, thereby improving the overall user experience.
[0079] Based on the above examples, please refer to Figure 8 In one of the exemplary embodiments provided in the present application, the specific implementation process of the above text switching method may also include steps S810 to S830, which are described in detail as follows:
[0080] Step S810, determining a text switching type based on target text information and current target text information;
[0081] Step S820: determining a text switching switch based on the text switching type, where the text switching switch is used to distinguish different state machines.
[0082] Step S830, displaying or hiding a data tag on the interface through state machine control, the data tag includes a data node for triggering an event, so as to access a preset connection animation or access target text information through the data node.
[0083] Exemplarily, it is necessary to determine the text switching type based on the difference between the target text information (i.e., the text to be displayed) and the current target text information (i.e., the text displayed on the current interface). The text switching type may include complete replacement (i.e., the target text completely replaces the current text), partial replacement (i.e., the target text only replaces a part of the current text), appending (i.e., appending the target text after the current text), inserting (i.e., inserting the target text at a certain position of the current text), etc. Afterwards, the text switching switch is determined according to the text switching type. Among them, the text switching switch can be a logical control point for distinguishing different state machines, and the state machine is a mathematical model for describing how to respond to input events and internal events in different states. Then, according to the value of the text switching switch (such as on or off), it can be determined which state machine is used to control the display or hiding of text switching and data labels. Data tags are elements on the interface used to display additional information or trigger events. These data tags may include data nodes for triggering animations, or directly display target text information. And the state machine can respond to user interactions or internal events by controlling the display or hiding of data tags. For example, when a user clicks a button, the state machine may switch to a new state and display a data label containing target text information. The data node in the data label is not only used to trigger events, but also can be used to access preset transition animations or target text information. In this embodiment, the transition animation can be an animation effect used to smoothly transition between two text information. When the text switch occurs, a transition animation may be played to enhance the user experience. The target text information is the text that is ultimately displayed on the interface. Then, the data label can be updated to the target text information through the data node and displayed to the user.
[0084] In some embodiments of the present application, through precise text switching types and switch controls, a smoother and more natural text switching experience can be provided to users, which avoids the abruptness when switching texts and enables users to browse and read information on the interface more comfortably. The display or hiding of data labels can be dynamically adjusted according to the actual needs of users, thereby improving the usability and ease of use of the user interface.
[0085] Fig. 9 It is a brief flowchart of text switching in an exemplary application scenario. In the application scenario shown in 9, the identification information corresponding to the current trigger event is obtained, and the identification information is used to determine the target text information corresponding to the current trigger event and the duration corresponding to the target text information; if the duration is greater than the preset duration threshold, the corresponding current text information on the interface is obtained; the text switching type is determined based on the target text information and the current target text information; the text switching switch is determined based on the text switching type, and the text switching switch is used to distinguish different state machines, and the state machine controls the display or hiding of data labels on the interface. The data label includes a data node for triggering the event, so as to access the preset connection animation or access the target text information through the data node. If the current text information represents that the interface is blank text, the preset connection animation is obtained; in response to the current trigger event, the preset connection animation is controlled to play until the interface loads the target text information. For the detailed implementation process, please refer to the records in the aforementioned embodiments, and no further description will be given here.
[0086] Fig.10 is a block diagram of a text switching device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The implementation environment shown in the figure is specifically configured in the server 120. The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applied.
[0087] like Fig.10 As shown, the exemplary text switching device 1000 includes: a first acquisition module 1010, which acquires identification information corresponding to the current trigger event, and the identification information is used to determine the target text information corresponding to the current trigger event and the duration corresponding to the target text information; a second acquisition module 1020, which acquires the current text information corresponding to the interface if the duration is greater than a preset duration threshold; a third acquisition module 1030, which acquires a preset connection animation if the current text information representation interface is blank text; and a control module 1040, which responds to the current trigger event and controls the preset connection animation to play until the interface loads the target text information.
[0088] According to one aspect of an embodiment of the present application, the above-mentioned control module 1040 also includes: determining the playback start time corresponding to the target text information based on the identification information; determining the playback end time of the preset connection animation based on the playback start time; responding to the current trigger event, and controlling the preset connection animation to play until the playback end time.
[0089] According to one aspect of the embodiment of the present application, the control module 1040 further includes: acquiring the current operating environment, determining the loading duration of the target text information based on the operating environment; and determining the playback deadline based on the loading duration.
[0090] According to one aspect of the embodiment of the present application, the control module 1040 further includes: obtaining the data size corresponding to the target text information; determining the playback duration of the preset connection animation based on the data size, and determining the playback deadline based on the playback duration.
[0091] According to one aspect of an embodiment of the present application, the above-mentioned control module 1040 also includes: if the data size is greater than or equal to a preset data threshold, then the playback duration of the preset connection animation is determined to be a first preset playback duration; if the data size is less than the preset data threshold, then the playback duration of the preset connection animation is determined to be a second preset playback duration, and the second playback duration is less than the first preset playback duration.
[0092] According to one aspect of an embodiment of the present application, the above-mentioned text switching device 1000 also includes: a determination module, if the current text information representation interface is not blank text, determines the playback duration and current playback time of the current text based on the current animation information; determines the playback start time of the target text information based on the playback duration and current playback time of the current text.
[0093] According to one aspect of an embodiment of the present application, the above-mentioned text switching device 1000 also includes: a state machine module, which determines the text switching type based on the target text information and the current target text information; determines the text switching switch based on the text switching type, and the text switching switch is used to distinguish different state machines, and the state machine controls the display or hiding of data labels on the interface. The data labels include data nodes for triggering events, so as to access preset connection animations or access target text information through data nodes.
[0094] The text switching device provided in the above embodiment and the text switching method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the text switching device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0095] An embodiment of the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the text switching method provided in the above-mentioned embodiments.
[0096] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. Fig.11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0097] like Fig.11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103, such as executing the method in the above embodiment. In the RAM 1103, various programs and data required for system operation are also stored. The CPU 1101, the ROM 1102 and the RAM 1103 are connected to each other through the bus 1104. The input / output (I / O) interface 1105 is also connected to the bus 1104.
[0098] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.
[0099] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.
[0100] The computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0101] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0102] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0103] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the text switching method as described above is implemented. The computer-readable storage medium can be included in the electronic device described in the above embodiment, or it can exist independently without being assembled into the electronic device.
[0104] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the text switching method provided in each of the above embodiments.
[0105] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.< / blank>
Claims
1. A text switching method, characterized in that: The method comprises: Acquire identification information corresponding to the current trigger event, where the identification information is used to determine target text information corresponding to the current trigger event and duration corresponding to the target text information; If the duration is greater than the preset duration threshold, the corresponding current text information on the interface is obtained; If the current text information indicates that the interface is blank text, then obtaining a preset connection animation; In response to the current trigger event, the preset connection animation is controlled to play until the interface loads the target text information.
2. The method according to claim 1, characterized in that The step of responding to the current trigger event and controlling the preset connection animation to play until the interface loads the target text information includes: Determine the playback start time corresponding to the target text information based on the identification information; Determine a preset end time of playback of the connection animation based on the playback start time; In response to the current trigger event, the preset connection animation is controlled to play until the play cut-off time.
3. The method according to claim 2, characterized in that The determining, based on the identification information, the corresponding playback start time of the target text information includes: Acquire the current operating environment, and determine the loading time of the target text information based on the operating environment; The playback deadline is determined based on the loading duration.
4. The method according to claim 2, characterized in that The determining, based on the identification information, the corresponding playback start time of the target text information includes: Obtaining the data size corresponding to the target text information; The playing duration of the preset connection animation is determined based on the data size, so as to determine the playing deadline based on the playing duration.
5. The method according to claim 4, characterized in that The determining the playing duration of the preset connection animation based on the data size includes: If the data size is greater than or equal to the preset data threshold, determining the playback duration of the preset connection animation to be the first preset playback duration; If the data size is smaller than the preset data threshold, the playback duration of the preset connection animation is determined to be a second preset playback duration, and the second preset playback duration is smaller than the first preset playback duration.
6. The method according to claim 1, characterized in that The method further comprises: If the current text information represents non-blank text on the interface, determining the playing duration of the current text and the current playing time based on the current animation information; The play start time of the target text information is determined based on the play duration of the current text and the current play time.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determine a text switching type based on the target text information and the current target text information; Determine a text switching switch based on the text switching type, wherein the text switching switch is used to distinguish different state machines, The state machine is used to control displaying or hiding of a data label on the interface, wherein the data label includes a data node for triggering an event, so as to access the preset connection animation or access the target text information through the data node.
8. A text switching device, characterized in that: The device comprises: A first acquisition module, acquiring identification information corresponding to a current trigger event, wherein the identification information is used to determine target text information corresponding to the current trigger event and a duration corresponding to the target text information; The second acquisition module acquires the corresponding current text information on the interface if the duration is greater than a preset duration threshold; A third acquisition module, if the current text information indicates that the interface is blank text, then acquires a preset connection animation; The control module responds to the current trigger event and controls the preset connection animation to play until the interface loads the target text information.
9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the text switching method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the text switching method according to any one of claims 1 to 7.