Ultra-precision numerical value processing method and device and electronic equipment
By using WASM bytecode to process super-precision values on the server, the problem of accuracy loss in JavaScript when processing super-precision values is solved, and the accuracy and consistency of processing are improved.
Patent Information
- Application Number
- CN202510096938.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-16
AI Technical Summary
JavaScript has a problem of accuracy loss when processing super-precision values, resulting in low accuracy of processing.
The client forwards a pending string containing super-precision values to the server. The server calls WASM bytecode to process the to-process string and returns the processing result to avoid the loss of accuracy when the client uses JavaScript scripts to process.
Improve the accuracy of ultra-precision numerical processing, ensure that the data remains consistent throughout the processing process, and reduce the probability of data inconsistency and errors caused by accuracy problems.
Smart Images

Figure CN120011105A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer software and Web application development, and in particular to an ultra-precision numerical processing method, device and electronic device. Background Art
[0002] In the development of modern web applications, JavaScript is often used as the front-end programming language of web applications due to the frequent interaction between the front-end and back-end. Its built-in numeric type is based on the double-precision floating-point number of the IEEE 754 standard. This numeric type performs well when processing values within the normal range, but when processing long integers and extended-precision floating-point values (i.e., integers and floating-point numbers beyond the normal range) in byte streams, JavaScript will have precision loss problems. Specifically, the maximum safe integer of JavaScript is 2. 53 -1, which is 9,007,199,254,740,991. Use JavaScript to handle numbers above this negative 2. 53 -1 to positive 2 53 -1 (i.e., super-precision value), the precision of this super-precision value may be lost, resulting in low accuracy in super-precision value processing. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide an ultra-precision numerical processing method, device and electronic device for improving the problem of low accuracy of ultra-precision numerical processing.
[0004] The embodiment of the present application provides a method for processing ultra-precision numbers, including: extracting a string to be processed containing ultra-precision numbers from a serialized byte stream through a scripting language; forwarding the string to be processed to a server, so that the server calls the WASM bytecode to process the string to be processed, and returns the processing result of the string to be processed. In the implementation process of the above scheme, the client forwards the string to be processed containing ultra-precision numbers to the server. Since the server calls the WASM bytecode to process the string to be processed and returns the processing result of the string to be processed, the problem of precision loss encountered by the client when using JavaScript script processing is avoided, and the numerical type restrictions of JavaScript are effectively bypassed, thereby improving the accuracy of ultra-precision numerical processing.
[0005] Optionally, in an embodiment of the present application, after forwarding the string to be processed to the server, it also includes: obtaining the processing result of the string to be processed, the processing result includes: the sequence operation result obtained by the server deserializing the string to be processed; extracting the ultra-precision value from the sequence operation result. In the implementation process of the above scheme, by transmitting the ultra-precision value as a string and accurately processing it on the server, it is ensured that the data remains consistent throughout the entire processing flow, reducing the probability of data inconsistency and errors caused by precision problems, thereby improving the accuracy of ultra-precision value processing.
[0006] Optionally, in an embodiment of the present application, before extracting the ultra-precision value from the sequence operation result, it also includes: obtaining the processing result of the string to be processed; parsing the sequence operation result in the processing result. In the implementation process of the above scheme, by transmitting the ultra-precision value as a string and accurately processing it on the server side, it is ensured that the data remains consistent throughout the entire processing flow, so that the client only needs to be responsible for sending requests and receiving results, and the complex processing logic is completed by the server side, which reduces the amount of code and complexity of the client, and reduces the development and maintenance costs.
[0007] Optionally, in an embodiment of the present application, after extracting the ultra-precision value from the sequence operation result, it further includes: using a browser to render the ultra-precision value. In the implementation process of the above scheme, by directly rendering the ultra-precision value on the browser side, real-time display of data can be achieved, and the user does not need to wait for additional server responses or page refreshes, making the application more responsive and improving the user experience.
[0008] The embodiment of the present application also provides a method for processing ultra-precision numerical values, which is applied to the server, including: receiving a forwarded string to be processed, where the string to be processed is a string containing ultra-precision numerical values extracted from a serialized byte stream by a scripting language; calling WASM bytecode to process the string to be processed, and obtaining the processing result of the string to be processed. In the implementation process of the above scheme, WASM bytecode can be run at a speed close to that of native code in modern browsers and server environments, which enables complex numerical calculation tasks to be executed efficiently and improves the performance of the overall system.
[0009] Optionally, in an embodiment of the present application, calling WASM bytecode to process the string to be processed includes: calling WASM bytecode to deserialize the string to be processed to obtain the sequence operation result; or, calling WASM bytecode to format the string to be processed for JSON; or, calling WASM bytecode to format the string to be processed for XML; or, calling WASM bytecode to format the string to be processed for YAML. In the implementation process of the above scheme, by calling WebAssembly (WASM) bytecode to deserialize or format the string to be processed (such as JSON, XML, YAML, etc.), due to the high performance characteristics of WASM, the server can more effectively utilize CPU resources when processing a large number of requests, thereby reducing the overall computing load.
[0010] An embodiment of the present application also provides an ultra-precision numerical processing device, including: an ultra-precision string extraction module, used to extract a to-be-processed string containing an ultra-precision numerical value from a serialized byte stream through a scripting language; an ultra-precision string forwarding module, used to forward the to-be-processed string to a server, so that the server calls the WASM bytecode to process the to-be-processed string and returns the processing result of the to-be-processed string.
[0011] Optionally, in an embodiment of the present application, the ultra-precision numerical processing device further includes: a processing result acquisition module, used to obtain the processing result of the string to be processed, the processing result including: a sequence operation result obtained by the server deserializing the string to be processed; and an ultra-precision numerical module, used to extract ultra-precision numerical values from the sequence operation results.
[0012] Optionally, in an embodiment of the present application, the ultra-precision numerical processing device further includes: a bytecode acquisition module, used to obtain a processing result of the character string to be processed; and a bytecode parsing module, used to parse out a sequence operation result from the processing result.
[0013] Optionally, in an embodiment of the present application, the ultra-precision numerical processing device further includes: an ultra-precision numerical rendering module, which is used to render the ultra-precision numerical values using a browser.
[0014] The embodiment of the present application also provides an ultra-precision numerical processing device, which is applied to a server, including: a string receiving module, which is used to receive a forwarded string to be processed, where the string to be processed is a string containing an ultra-precision numerical value extracted from a serialized byte stream through a scripting language; a string processing module, which is used to call WASM bytecode to process the string to be processed and obtain a processing result of the string to be processed.
[0015] Optionally, in an embodiment of the present application, the string processing module includes: a deserialization submodule, used to call the WASM bytecode to deserialize the string to be processed and obtain a sequence operation result; or, a JSON formatting submodule, used to call the WASM bytecode to perform JSON formatting on the string to be processed; or, an XML formatting submodule, used to call the WASM bytecode to perform XML formatting on the string to be processed; or, a YAML formatting submodule, used to call the WASM bytecode to perform YAML formatting on the string to be processed.
[0016] An embodiment of the present application further provides an electronic device, including: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the machine-readable instructions execute the method described above when executed by the processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A flow chart of a method for ultra-precision numerical processing applied to a client provided in an embodiment of the present application is shown;
[0019] Figure 2 A schematic diagram of a timing diagram of interaction between a client and a server provided in an embodiment of the present application is shown;
[0020] Figure 3 A flow chart of an ultra-precision numerical processing method applied to a server provided in an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram of the structure of an ultra-precision numerical processing device provided in an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] To make the purpose, technical scheme and advantages of the embodiment of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. It should be understood that the drawings in the embodiment of the present application only serve the purpose of explanation and description, and are not used to limit the protection scope of the embodiment of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in the embodiment of the present application shows the operation implemented according to some embodiments of the embodiment of the present application. It should be understood that the operation of the flowchart can be implemented out of order, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the embodiment of the present application, or remove one or more operations from the flowchart.
[0024] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all embodiments. The components of the embodiments of the present application described and shown in the drawings generally here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the embodiments of the present application claimed, but merely represents the selected embodiments of the embodiments of the present application.
[0025] It is understandable that the "first" and "second" in the embodiments of the present application are used to distinguish similar objects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit the difference. In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that there may be three relationships, such as A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the related objects before and after are in an "or" relationship. The term "multiple" refers to more than two (including two), and similarly, "multiple groups" refers to more than two groups (including two groups).
[0026] It should be noted that the ultra-precision numerical processing method provided in the embodiment of the present application can be executed by an electronic device, where the electronic device refers to a device terminal or server with the function of executing a computer program, such as a smart phone, a personal computer, a tablet computer, a personal digital assistant, or a mobile Internet device. A server refers to a device that provides computing services through a network, such as an x86 server and a non-x86 server, and a non-x86 server includes a mainframe, a minicomputer, and a UNIX server.
[0027] In the related art, the client can run a browser or an application developed based on the browser. In the process of running the JavaScript scripting language on the client, it is found that since Javascript uses the double-precision floating-point number of the IEEE 754 specification as the digital type, this specification causes the JavaScript script to parse and process the ultra-precision numerical value sent by the server backend. There will be a distortion problem of precision loss. For example: suppose a browser running on a personal computer receives a string containing an ultra-precision numerical value from a server, and uses json-bigint to serialize, deserialize or use JSON.stringify to format the string. If the processed string is displayed again, it will be found that the precision of the ultra-precision numerical value is lost (the last few digits may all be displayed as 0). Among them, serialization is to convert a string or data that conforms to a certain specific rule into a data structure that can be used in a specific programming language, and deserialization is to convert a data structure used in a specific programming language into a string or data that conforms to a certain specific rule.
[0028] For the above questions, please see Figure 1 The flowchart of the method for processing ultra-precision numbers applied to the client provided by the embodiment of the present application is shown; the main idea of the method is to forward the string to be processed containing ultra-precision numbers to the server for processing, and the server can call WASM bytecode to process the string to be processed, avoiding the problem of precision loss encountered when the client directly uses JavaScript script processing, thereby improving the accuracy of ultra-precision number processing. The implementation method of the above-mentioned method for processing ultra-precision numbers applied to the client may include:
[0029] Step S110: The client extracts the character string to be processed containing the ultra-precision numerical value from the serialized byte stream by using a scripting language.
[0030] The above scripting language can be JavaScript scripting language or Python scripting language. The common feature of these scripting languages is that they all adopt the IEEE754 standard. For example, the built-in digital type of JavaScript is based on the double-precision floating point number of the IEEE754 standard, Python uses the double-precision floating point number (64 bits) of the IEEE754 standard, Java's float and double types are also based on the IEEE754 standard, C and C++'s float and double types are also based on the IEEE754 standard, C#'s float and double types are also based on the IEEE754 standard, etc.
[0031] It is understandable that the client and the server are relative concepts, that is, the server is the provider of ultra-precision numerical processing services, and the client is the recipient of ultra-precision digital processing services. The client and the server can run on the same electronic device, of course, the client and the server can also run on different electronic devices, and whether to run on the same electronic device can be set according to specific needs.
[0032] See also Figure 2 The timing diagram of the interaction between the client and the server provided by the embodiment of the present application is shown; the implementation method of the above step S110 is, for example: the environment in which the above client runs the JavaScript script can be a browser running the Electron environment, and the Electron environment can also include nodejs. The browser on the client can use nodejs to send a data request to the server through the HyperText Transfer Protocol (HTTP). After receiving the data request sent by the client, the server can obtain the serialized byte stream corresponding to the data request (for example, the serialized byte stream can be found in the cache library or database. If it is not found, the data object corresponding to the data request can be found, and the data object can be serialized to obtain the above-mentioned serialized byte stream), and then the server sends the serialized byte stream corresponding to the data request to the client. After receiving the serialized byte stream sent by the server, the client can extract the to-be-processed string containing the ultra-precision value from the serialized byte stream, and the browser on the client can also use nodejs to render the to-be-processed string containing the ultra-precision value.
[0033] Step S120: the client forwards the string to be processed to the server, so that the server calls the WASM bytecode to process the string to be processed and returns the processing result of the string to be processed.
[0034] Among them, the above-mentioned server calls WASM bytecode to process the pending string in many ways, such as deserialization, JSON formatting, XML formatting, YAML formatting or JSON parsing, etc. The above-mentioned WASM is a low-level bytecode format that can run on any platform that supports it, including modern browsers. By using bytecode compiled by languages such as WASM to process the pending strings containing ultra-precision values, it can be ensured that these values will not lose precision during the processing process.
[0035] An implementation example of the above step S120 is: the browser on the client can use nodejs to forward the string to be processed to the server. After the server obtains the string to be processed forwarded by the client, it can call the WASM bytecode to process the string to be processed and return the processing result of the string to be processed. After the browser on the client obtains the processing result of the string to be processed forwarded by the server, it can also use nodejs to render the processing result of the string to be processed. It can be understood that the ultra-precision numerical value is transmitted as a string and accurately processed in WASM to ensure that the data remains consistent throughout the entire processing flow.
[0036] Among them, the implementation method of the above-mentioned server calling WASM bytecode to process the string to be processed may include: the server calling WASM bytecode to deserialize the string to be processed to obtain a sequence operation result, or the server calling WASM bytecode to perform JSON formatting, XML formatting or YAML formatting on the string to be processed.
[0037] In the implementation process of the above solution, the client forwards the to-be-processed string containing the ultra-precision numerical value to the server. Since the server calls the WASM bytecode to process the to-be-processed string and returns the processing result of the to-be-processed string, the problem of precision loss encountered by the client when using JavaScript script processing is avoided, and the numerical type limitation of JavaScript is effectively bypassed, thereby improving the accuracy of ultra-precision numerical processing.
[0038] As an optional implementation of the above-mentioned method for processing ultra-precision numerical values, after forwarding the character string to be processed to the server, the ultra-precision numerical value may also be extracted from the processing result forwarded by the server. The implementation may include:
[0039] Step S130: Obtain the processing result of the string to be processed, where the processing result includes: the sequence operation result obtained by the server side by deserializing the string to be processed.
[0040] The implementation method of the above step S130 is, for example: after the client forwards the string to be processed to the server via the HTTP protocol or the HTTPS protocol, it can also receive the processing result of the string to be processed forwarded by the server, and use nodejs to parse the sequence operation result from the processing result. The sequence operation result is obtained by the server deserializing the string to be processed.
[0041] Step S140: extracting ultra-precision numerical values from the sequence operation results.
[0042] The implementation method of the above step S130 is, for example: nodejs can be run on the client, and then nodejs can extract ultra-precision values from the sequence operation results returned by the server through regular expressions or JSON, and these ultra-precision values can be stored in the form of strings, so as to ensure the accuracy of these values. Optionally, the client can also use the BigInt library or a special high-precision library (such as big.js) to convert the ultra-precision values stored in the string form into other data types (such as ultra-large integer BigInt).
[0043] As an optional implementation of the above-mentioned ultra-precision numerical processing method, before extracting the ultra-precision numerical value from the sequence operation result, it also includes:
[0044] Step S141: obtaining a processing result of the string to be processed, where the processing result includes: a sequence operation result obtained by the server side by serializing or deserializing the string to be processed.
[0045] It is understandable that when the server serializes or deserializes the string to be processed, it can use more powerful computing resources and specialized libraries (such as num-bigint in Rust) to process ultra-precision values to ensure that the data does not lose precision during processing. When running in modern browsers and server environments, WASM bytecode can be close to the speed of native code, which means that for complex serialization and deserialization operations, WASM can provide significant performance improvements. Since the client only needs to send the string to be processed, without sending the entire processing logic or a large amount of intermediate data, the result returned by the server after processing is usually smaller than the original data, reducing network transmission and improving response speed.
[0046] Step S142: parse the sequence operation result from the processing result.
[0047] The implementation method of the above steps S141 to S142 is, for example: the client receives the processing result of the string to be processed forwarded by the server through the HTTP protocol or the HTTPS protocol, and locates and extracts the sequence operation result in the processing result through the WASM bytecode running in the browser, and then verifies whether the extracted data conforms to the expected format and content. After verifying whether the extracted data conforms to the expected format and content, the extracted data can also be converted to an appropriate data type. It is understandable that when the WASM code runs in the browser, it can be close to the speed of the native code, which allows complex computing tasks to be completed efficiently on the front end and reduces the burden on the back-end server.
[0048] In the implementation process of the above solution, by transmitting ultra-precision values as strings and accurately processing them on the server side, the consistency of data is ensured throughout the entire processing flow, reducing the probability of data inconsistency and errors due to precision issues, thereby improving the accuracy of ultra-precision value processing.
[0049] As an optional implementation of the above-mentioned ultra-precision numerical processing method, after extracting the ultra-precision numerical value from the sequence operation result, it also includes:
[0050] Step S150: Use a browser to render the ultra-precision numerical value.
[0051] An implementation example of the above step S150 is as follows: the above browser may be a browser running an Electron environment, and the Electron environment may also include nodejs, and the browser may use nodejs to render the ultra-precision values. Optionally, if the values are dynamically changing (for example, real-time transaction data in financial applications), they can be updated and rendered instantly on the browser side to provide the latest information to the user. Since the browser supports a variety of front-end frameworks and technologies (such as React, Vue, Angular, etc.), a highly interactive and beautiful user interface can be created. For ultra-precision values, charts, animations or other visual elements can be used to enhance the expressiveness of the data.
[0052] Optionally, you can also customize the display format of the values as needed, such as adding thousands separators, currency symbols, decimal places, etc., to make the data easier to understand and read. Once the data is passed to the client, the subsequent rendering work is completed by the browser, which reduces the demand for server resources and helps reduce server load in high-concurrency scenarios. By placing the rendering logic on the client, developers are allowed to make adaptive adjustments based on different devices and screen sizes. Since only raw data needs to be transmitted instead of complete HTML content, network bandwidth usage can be significantly reduced, improving overall performance.
[0053] See also Figure 3 The flowchart of the ultra-precision numerical processing method applied to the server provided in the embodiment of the present application is shown; the embodiment of the present application provides an ultra-precision numerical processing method, including:
[0054] Step S210: the server receives the character string to be processed forwarded by the client, where the character string to be processed is a character string containing an ultra-precision numerical value extracted from a serialized byte stream by a scripting language.
[0055] The implementation method of the above step S210 is, for example: the environment in which the above client runs the JavaScript script can be a browser running the Electron environment, and the Electron environment can also include nodejs. The browser on the client can use nodejs to send a data request to the server through the HyperText Transfer Protocol (HTTP). After receiving the data request sent by the client, the server can obtain the serialized byte stream corresponding to the data request (for example, the serialized byte stream can be found in the cache library or database. If it is not found, the data object corresponding to the data request can be found, and the data object can be serialized to obtain the above-mentioned serialized byte stream). Then, the server sends the serialized byte stream corresponding to the data request to the client. After receiving the serialized byte stream sent by the server, the client can extract the to-be-processed string containing the ultra-precision value from the serialized byte stream, and can forward the to-be-processed string to the server through the HTTP protocol or the HTTPS protocol. The server can receive the to-be-processed string forwarded by the client through the HTTP protocol or the HTTPS protocol, so as to call the WASM bytecode to process the to-be-processed string.
[0056] Step S220: The server calls the WASM bytecode to process the string to be processed and obtains a processing result of the string to be processed.
[0057] It is understandable that the reason why the server calls WASM bytecode to process the string to be processed is that the processing of WASM bytecode is different from that of JavaScript. WASM bytecode can directly and normally process the ultra-precision values in the string to be processed without the problem of precision loss. The above WASM bytecode can be compiled and generated by code written in languages such as Rust, Python or Haskell.
[0058] Optionally, by handing over some processing tasks (such as serialization and deserialization) to the server, the server can also perform distributed processing, thereby utilizing the server's powerful computing power to reduce the burden on the client, thereby improving the performance of the overall system. Furthermore, the server can also perform strict data verification and validation during the processing process to ensure the integrity and correctness of the data. If data anomalies or errors are found, the server can return error information in a timely manner to prevent the client from using incorrect data for subsequent processing to prevent malicious input or data corruption. In addition, sensitive processing logic and server resources are placed on the server to avoid exposure to the client, thereby improving the security of the system.
[0059] Step S230: the server forwards the processing result of the character string to be processed to the client.
[0060] An example of an implementation of step S230 is as follows: after the server calls the WASM bytecode to process the string to be processed, it can forward the processing result of the string to be processed to the client. The browser on the client receives the processing result of the string to be processed forwarded by the server, and uses nodejs to render the processing result of the string to be processed. Due to the high performance characteristics of WASM, the server can process requests and return results faster, reducing user waiting time.
[0061] Optionally, the same WASM module can be used for both the frontend and the backend.
[0062] As an optional implementation of the above step S220, the implementation of the above server calling WASM bytecode to process the string to be processed may include: the server calling WASM bytecode to perform serialization or deserialization and other sequence operations on the string to be processed to obtain the sequence operation result; or, the server calling WASM bytecode to perform JSON formatting on the string to be processed; or, the server calling WASM bytecode to perform XML formatting on the string to be processed; or, the server calling WASM bytecode to perform YAML formatting on the string to be processed. Among them, the above JSON is a JavaScript object representation format, which is a standard for representing structured data as JavaScript objects.
[0063] Optionally, the processing logic of ultra-precision numbers can be encapsulated in a WASM module, which can achieve modular development and maintenance, allowing developers to focus only on the implementation of the WASM module without having to repeatedly write similar code in multiple places, so that the WASM module can be reused in different projects and applications, reducing development costs and maintenance difficulties. This allows the server's processing logic to be developed and maintained independently of the client, making the system more modular. This design allows the server to be expanded and optimized as needed without affecting the client. Furthermore, the above-mentioned WASM module can provide a more fine-grained error handling mechanism to ensure that various abnormal situations can be captured and handled when processing ultra-precision numbers.
[0064] See also Figure 4 The structural diagram of the ultra-precision numerical processing device provided by the embodiment of the present application is shown; the embodiment of the present application provides an ultra-precision numerical processing device 300, which can be applied to a client, and the ultra-precision numerical processing device 300 can include:
[0065] The ultra-precision string extraction module 310 is used to extract the to-be-processed string containing the ultra-precision value from the serialized byte stream by using a scripting language.
[0066] The ultra-precision string forwarding module 320 is used to forward the string to be processed to the server, so that the server calls the WASM bytecode to process the string to be processed and returns the processing result of the string to be processed.
[0067] As an optional implementation of the above device, the ultra-precision numerical processing device further includes:
[0068] The processing result acquisition module is used to obtain the processing result of the string to be processed, and the processing result includes: the sequence operation result obtained by the server side deserializing the string to be processed.
[0069] The ultra-precision numerical module is used to extract ultra-precision numerical values from sequence operation results.
[0070] As an optional implementation of the above device, the ultra-precision numerical processing device further includes:
[0071] The bytecode acquisition module is used to obtain the processing result of the string to be processed.
[0072] The bytecode parsing module is used to parse out the sequence operation results in the processing results.
[0073] As an optional implementation of the above device, the ultra-precision numerical processing device further includes:
[0074] The ultra-precision numerical rendering module is used to render ultra-precision numerical values using a browser.
[0075] The embodiment of the present application further provides an ultra-precision numerical processing device applied to a server, which may include:
[0076] The string receiving module is used to receive a forwarded string to be processed, where the string to be processed is a string containing an ultra-precision numerical value extracted from a serialized byte stream by a scripting language.
[0077] The string processing module is used to call the WASM bytecode to process the string to be processed and obtain the processing result of the string to be processed.
[0078] As an optional implementation of the above device, the string processing module includes:
[0079] The deserialization submodule is used to call the WASM bytecode to deserialize the string to be processed and obtain the sequence operation result.
[0080] Alternatively, the JSON formatting submodule is used to call the WASM bytecode to perform JSON formatting on the string to be processed.
[0081] Alternatively, the XML formatting submodule is used to call the WASM bytecode to perform XML formatting on the string to be processed.
[0082] Alternatively, the YAML formatting submodule is used to call the WASM bytecode to perform YAML formatting on the string to be processed.
[0083] It should be understood that the device corresponds to the above-mentioned ultra-precision numerical processing method embodiment and can execute the various steps involved in the above-mentioned method embodiment. The specific functions of the device can be referred to in the above description, and the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the operating system (OS) of the device.
[0084] See also Figure 5 An electronic device 400 provided in an embodiment of the present application includes: a processor 410 and a memory 420, wherein the memory 420 stores machine-readable instructions executable by the processor 410, and when the machine-readable instructions are executed by the processor 410, the above method is executed.
[0085] The embodiment of the present application also provides a computer-readable storage medium 430, on which a computer program is stored, and the computer program is executed by the processor 410 to execute the above method. The computer-readable storage medium 430 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk.
[0086] The embodiment of the present application also provides a computer program product, including: a computer program or a computer instruction, and the computer program or the computer instruction executes the method described above when executed by a processor.
[0087] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0088] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed device and method can also be implemented in other ways. The device embodiments described above are only schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a part of a module, a program segment or a code, and a part of a module, a program segment or a code includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also be different from the order of occurrence marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which is mainly determined by the functions involved.
[0089] In addition, each functional module of each embodiment in the embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. In addition, in the description of this specification, the description of reference terms "one embodiment", "some embodiments", "example", "specific example", "some examples", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present application. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples without contradiction.
[0090] The above description is only an optional implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application.
Claims
1. A super-precision numerical processing method, characterized in that: include: Extract the string to be processed containing the ultra-precision value from the serialized byte stream through the scripting language; Forward the string to be processed to the server, so that the server calls the WASM bytecode to process the string to be processed and returns the processing result of the string to be processed.
2. The method according to claim 1, characterized in that After forwarding the character string to be processed to the server, the method further includes: Obtaining a processing result of the string to be processed, the processing result comprising: a sequence operation result obtained by the server end by deserializing the string to be processed; The ultra-precision numerical value is extracted from the sequence operation result.
3. The method according to claim 2, characterized in that Before extracting the ultra-precision value from the sequence operation result, the method further includes: Obtaining the processing result of the character string to be processed; The sequence operation result is parsed out from the processing result.
4. The method according to claim 2 or 3, characterized in that: After extracting the ultra-precision value from the sequence operation result, the method further includes: The ultra-precision numerical value is rendered using a browser.
5. A super-precision numerical processing method, characterized in that: Applied to the server, including: Receiving a forwarded character string to be processed, wherein the character string to be processed is a character string containing an ultra-precision numerical value extracted from a serialized byte stream by a scripting language; The WASM bytecode is called to process the string to be processed, and a processing result of the string to be processed is obtained.
6. The method according to claim 5, characterized in that The calling of WASM bytecode to process the string to be processed includes: Call the WASM bytecode to deserialize the string to be processed to obtain a sequence operation result; Alternatively, the WASM bytecode is called to perform JSON formatting on the string to be processed; Alternatively, the WASM bytecode is called to perform XML formatting on the character string to be processed; Alternatively, the WASM bytecode is called to perform YAML formatting on the string to be processed.
7. An ultra-precision numerical processing device, characterized in that: include: An ultra-precision string extraction module is used to extract a to-be-processed string containing an ultra-precision value from a serialized byte stream using a scripting language; The ultra-precision string forwarding module is used to forward the string to be processed to the server, so that the server calls the WASM bytecode to process the string to be processed and returns the processing result of the string to be processed.
8. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the machine-readable instructions are executed by the processor to perform any method according to claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is executed.
10. A computer program product, characterized in that include: A computer program or a computer instruction, wherein when the computer program or the computer instruction is executed by a processor, the method according to any one of claims 1 to 6 is executed.